A NLP (Natural Language Processing) Java Application which detects Names
, organizaions
, and locations
in a text by running Hugging face's Roberta NER model using ONNX runtime and Deep Java Library
Open Project folder in Java IDE (Recommended: IntelliJ IDEA Community
) with gradle support and Build the project
- Java Development Kit JDK version: 11
- Gradle version 7+
These files are required to run the project
- ONNX model
tokenizer.json
file
To convert HuggingFace NER model to ONNX Open this Google Colaboratory Notebook run the code as image shown below and follow all the steps
(the code for above purpose is also saved in jupyter notebook in the file convert Huggingface model to ONNX.ipynb
. you can run the code using Jupyter notebook)
after running the one of above codes your onnx model will be saved in onnx/
folder.
Tokenzer file tokenizer.json
was taken from this huggingface repo
Download the tokenizer.json
from the link
move files
Copy files created from above two stesp into raw-files
directory as shown in the below image
Build the project using This button
Open the Main.java
file and click the play button as shown in the red box in the below image