Git Product home page Git Product logo

ner-nlp-with-onnx-java's Introduction

Run HuggingFace NER (NLP) Model on Java using ONNX Runtime and DJL

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

Installation:

Open Project folder in Java IDE (Recommended: IntelliJ IDEA Community) with gradle support and Build the project

Requirements:

  1. Java Development Kit JDK version: 11
  2. Gradle version 7+

Download files

These files are required to run the project

  1. ONNX model
  2. tokenizer.json file

Convert the ONNX model

To convert HuggingFace NER model to ONNX Open this Google Colaboratory Notebook run the code as image shown below and follow all the steps

run colab code cell

(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.

Download tokenizer.json

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

raw-files path

Building project

Build the project using This button

how to build project

Run the Code

Open the Main.java file and click the play button as shown in the red box in the below image
how to run project

ner-nlp-with-onnx-java's People

Contributors

ahwar avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

wallbase oxqqqq

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.