Developing a negation-aware named entity recognition system in the product search context
- Run command
conda env update --file env.yaml --prune
to download all the required dependencies - Create training set for NER model with command
python code/TrainSet_Generator.py
- Run the API server with
uvicorn main:app --reload --app-dir=code/
- Create knowledge base for product names by uploading the file using -
http://127.0.0.1:8000/uploadfile/
endpoint
REQUEST:
curl -X 'POST' \
'http://127.0.0.1:8000/extractInformation/' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"message": "I want a blackk dress with no pink ribbons",
"language": "English",
"correct_spellings": true,
"negationStyle": "tags"
}'
RESPONSE:
{
"tokens": [
"I",
"want",
"a",
"black",
"dress",
"with",
"no",
"pink",
"ribbons"
],
"tags": [
"O",
"O",
"O",
"I-COLOUR",
"I-ATTRIBUTE",
"O",
"O",
"I-ATTRIBUTE",
"I-ATTRIBUTE"
],
"isNegative": [
false,
false,
false,
false,
false,
false,
false,
true,
true
]
}