https://github.com/razamehar/entity-extraction-with-langextract
https://github.com/razamehar/entity-extraction-with-langextract
langextract large-language-models openai python text-extraction
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/razamehar/entity-extraction-with-langextract
- Owner: razamehar
- Created: 2025-08-17T22:58:35.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-08-17T23:00:03.000Z (about 2 months ago)
- Last Synced: 2025-08-18T01:04:04.090Z (about 2 months ago)
- Topics: langextract, large-language-models, openai, python, text-extraction
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Entity Extraction with LangExtract
This project demonstrates how to use [LangExtract](https://pypi.org/project/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
```otpt
person_name Amir {'country': 'Egypt'}
country Cairo {'person_name': 'Amir'}
skill-set sketching intricate blueprints {'person_name': 'Amir'}
```## Installation
```bash
pip install -r requirements.txt
```## Requirements
- Python 3.8+
- LangExtract
- OpenAI API key set as environment variable:```bash
export OPENAI_API_KEY="your_api_key_here"
```