Skip to content

razamehar/Entity-Extraction-with-LangExtract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Entity Extraction with LangExtract

This project demonstrates how to use LangExtract with OpenAI models to extract structured information such as person names, countries, and skill sets from unstructured text.

How It Works

  1. Define extraction examples (EXAMPLES) and a prompt (PROMPT) for guidance.
  2. Pass input text to the extract_result function.
  3. Extracted entities (person_name, country, skill-set) are returned with attributes and character intervals.

Sample Output

person_name Amir {'country': 'Egypt'}
country Cairo {'person_name': 'Amir'}
skill-set sketching intricate blueprints {'person_name': 'Amir'}

Installation

pip install -r requirements.txt

Requirements

  • Python 3.8+
  • LangExtract
  • OpenAI API key set as environment variable:
export OPENAI_API_KEY="your_api_key_here"

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages