Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/j-sephb-lt-n/named-entity-recognition-microservice
An example of an API which extracts named entities from a provided user query
https://github.com/j-sephb-lt-n/named-entity-recognition-microservice
api cloud-run flask gcp gliner gliner-medium google-cloud google-cloud-run microservice nlp python query query-engine
Last synced: about 22 hours ago
JSON representation
An example of an API which extracts named entities from a provided user query
- Host: GitHub
- URL: https://github.com/j-sephb-lt-n/named-entity-recognition-microservice
- Owner: J-sephB-lt-n
- License: gpl-3.0
- Created: 2024-08-28T12:22:46.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-08-28T13:39:49.000Z (2 months ago)
- Last Synced: 2024-08-29T14:22:27.936Z (2 months ago)
- Topics: api, cloud-run, flask, gcp, gliner, gliner-medium, google-cloud, google-cloud-run, microservice, nlp, python, query, query-engine
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# named-entity-recognition-microservice
An example of an API which extracts named entities from a provided user query.
Some notes:
- I have not load tested it at all
- The model is being downloaded on the first client request (making it very slow). The model download should be moved to the Dockerfile (i.e. to the image build step)
Deploy it on a google Cloud Run service as follows:
```bash
GCP_PROJ_ID='your-gcp-proj-id'
GCP_REGION='europe-west2'
CREATE_ARTIFACT_REG_REPO_NAME='your-artifact-registry-repo-name'
CREATE_CLOUD_RUN_SERVICE_NAME='named-entity-recognition-test'gcloud auth login
gcloud config set project $GCP_PROJ_ID # verify with `gcloud config get project`
gcloud config set run/region $GCP_REGION # verify with `gcloud config get run/region`DOCKER_IMG_URI="${GCP_REGION}-docker.pkg.dev/${GCP_PROJ_ID}/${CREATE_ARTIFACT_REG_REPO_NAME}/${CREATE_CLOUD_RUN_SERVICE_NAME}"
make create_artifact_registry_repo \
ARTIFACT_REG_REPO_NAME=$CREATE_ARTIFACT_REG_REPO_NAME \
GCP_REGION=$GCP_REGION \
CLOUD_RUN_SERVICE_NAME=$CREATE_CLOUD_RUN_SERVICE_NAMEmake build \
DOCKER_IMG_URI=$DOCKER_IMG_URImake deploy \
CLOUD_RUN_SERVICE_NAME=$CREATE_CLOUD_RUN_SERVICE_NAME \
DOCKER_IMG_URI=$DOCKER_IMG_URI
```