This is a simple API to test the Natural Language Processing/Understanding offerings from Watson and Google.
- Create a Google Natural Language project.
- Create a Watson Natural Language Understanding Project.
- Duplicate
src/.env.sampletosrc/.env. - Add the path to the Google application credentials JSON file to the
src/.envfile. - Add the Watson project credentials to the
src/.envfile. - Set your preferred port number in the
src/.envfile.
# Install dependencies
npm install
# Start development live-reload server
npm run dev
# Start production server:
npm start# Build your docker
docker build -t nlp/api-service .
# run your docker
docker run -p 8080:8080 nlp/api-service
# run with port 8080 with either /api/google or /api/watson
# Replace example.com with your preferred site.
curl -X POST \
http://localhost:8080/api/google \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com"
}'MIT