This Flask API provides a simple web service for performing Named Entity Recognition (NER) using pre-trained models from the Hugging Face Transformers library.
-
Clone this repository:
git clone https://github.com/your-username/ner-api.git
-
Navigate to the project directory:
cd ner-api
-
Install the required Python packages:
pip install -r requirements.txt
-
Run the Flask application:
python app.py
-
Access the API using a web browser or an HTTP client like cURL or Postman.
Example:
-
Open a web browser and visit
http://localhost:5000/?query=Your%20text%20here
replacingYour%20text%20here
with the text you want to perform NER on. -
Alternatively, you can use cURL:
curl "http://localhost:5000/?query=Your%20text%20here"
-
- GET /:
- Params:
- query: The text to perform NER on.
- Returns:
- JSON response containing the input text and NER results.
- Params:
This API uses the dslim/bert-base-NER
model from Hugging Face's model hub for named entity recognition. You can replace it with any other model supported by the Transformers library.
This project is licensed under the MIT License. See the LICENSE file for details.