Giter VIP home page Giter VIP logo

promptingner's Introduction

PromptNER

Prompting For Named Entity Recognition

This is the home of the PromptNER tool, currently anonymized for conference submission purposes.

Installation

Very little is needed by way of installation, simply clone and install the requirements (we use Python 3.10.9 but many other versions should work without a problem)

You will also need to download nltk stopwords:

cd PromptNER
pip install -r requirements.txt
python -m nltk.downloader stopwords

You will have to set up an OpenAI account to use the GPT based Prompting models. Make sure to save the API key as an environment variable: (put this line in your ~/.bashrc file if you are on Ubuntu to avoid doing this everytime)

export OPENAI_API_KEY='YOUR API KEY HERE'

Running PromptNER on your own dataset or task

All PromptNER needs to perform Named Entity Recognition on a completely unseen task specification is

  • A definition of the concept of a named entity, written in natural language
  • A few examples (3-5 is usually good) of the task being done succesfully

Head on to the custom file and follow the ExampleConfig class to add in your desired specifications in the CustomClass, after this you should be able to import the 'get_ner_system' function and query it to get a function which takes in a sentence in text and outputs a list of extracted entities.

Reproducing Experiments

To reproduce the experiments in the paper visit the run file, you can adapt the main function to call either 'run_all_datasets' or 'ablate_best' to get all the results from the paper.

You will have to download the data from the drive link and extract it at root level of the repository.

promptingner's People

Contributors

dhananjayashok avatar

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.