NER TF 2.0 inference(single sentence)for CoNLL-2003 NER dataset.
A detailed blog for training the model in TF 2.0 is available at
https://medium.com/analytics-vidhya/ner-tensorflow-2-2-0-9f10dcf5a0a.
- Download and store glove.6B.100d.txt from here
- data folder has the dataset.
- model output files after training will be written to the model_output directory.
├── data
│ ├── train.txt
│ ├── valid.txt
│ ├── test.txt
│
├── embeddings
│ ├── glove.6B.100d.txt
│
├── model_output
│ ├── checkpoint
│ ├── embedding.pkl
│ ├── idx2Label.pkl
│ ├── model_weights.data-00000-of-00001
│ ├── model_weights.index
│ ├── word2Idx.pkl
│
python3 -m venv venv1
source venv1/bin/activate
pip install -r requirements.txtpython3 train.py --data data --output model_output --overwrite True To use api.py uncomment the
python3 api.pygunicorn --bind :8088 --workers 1 --threads 8 api:app
- test
curl -i -H "Content-Type: application/json" \
-X POST http://0.0.0.0:8088/test- single sentence
curl -i -H "Content-Type: application/json" \
-X POST http://0.0.0.0:8088/ner -d '{"sent":"Steve went to Paris"}'Visualisations
tensorboard --logdir=model_output/logs/train --port=6006 --bind_all
tensorboard --logdir=model_output/logs/valid --port=6006 --bind_all