govaitextextract extracts structured AI/tech initiative data from text for policy, news, and recruitment analysis.
Project description
govaitextextract
Extract structured information from government or organizational tech/AI initiatives
A Python package that processes text inputs (e.g., news headlines, announcements) to extract structured data about government or organizational technology and AI initiatives. It uses a language model to identify key details like entity, initiative name, focus, and more, returning results in a consistent format (JSON/XML-compatible).
📦 Installation
pip install govaitextextract
🚀 Usage
Basic Usage (Default LLM: ChatLLM7)
from govaitextextract import govaitextextract
user_input = "The Ministry of Digital Transformation announces a new AI project with 50 specialists."
response = govaitextextract(user_input)
print(response)
Custom LLM Integration
You can replace the default ChatLLM7 with any LangChain-compatible LLM (e.g., OpenAI, Anthropic, Google):
Using OpenAI:
from langchain_openai import ChatOpenAI
from govaitextextract import govaitextextract
llm = ChatOpenAI()
response = govaitextextract(user_input, llm=llm)
Using Anthropic:
from langchain_anthropic import ChatAnthropic
from govaitextextract import govaitextextract
llm = ChatAnthropic()
response = govaitextextract(user_input, llm=llm)
Using Google Generative AI:
from langchain_google_genai import ChatGoogleGenerativeAI
from govaitextextract import govaitextextract
llm = ChatGoogleGenerativeAI()
response = govaitextextract(user_input, llm=llm)
🔧 Parameters
| Parameter | Type | Description |
|---|---|---|
user_input |
str |
The input text (e.g., news headline) to process. |
api_key |
Optional[str] |
LLM7 API key (defaults to LLM7_API_KEY env var). |
llm |
Optional[BaseChatModel] |
Custom LangChain LLM (e.g., ChatOpenAI). Falls back to ChatLLM7. |
🔑 API Key & Rate Limits
- Default LLM:
ChatLLM7(from langchain_llm7). - Free Tier: Sufficient for most use cases.
- Custom Key: Pass via
api_keyorLLM7_API_KEYenv var. - Get a Key: Register at LLM7.
📜 Output Format
The function returns structured data (e.g., JSON-like) extracted from the input text, such as:
{
"entity": "Ministry of Digital Transformation",
"initiative_name": "New AI Project",
"specialists": 50,
"focus": "AI"
}
📝 Notes
- Uses regex validation for consistency.
- Error handling included for LLM failures.
- Extensible for custom patterns via
patternin prompts.
📢 Issues & Support
Report bugs or feature requests at: GitHub Issues
👤 Author
Eugene Evstafev 📧 hi@euegne.plus 🔗 GitHub: chigwell
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file govaitextextract-2025.12.21194243.tar.gz.
File metadata
- Download URL: govaitextextract-2025.12.21194243.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3d3ab4501be245f387687da3f8597c33f0fd754aa868ad85492217f1c4d5580
|
|
| MD5 |
f68e75f85945ce0e5bfaa66024e52cb6
|
|
| BLAKE2b-256 |
420aa359b3f41c8a451857fc9b6c4461895e38923d44fa8820e9d0025d021f4f
|
File details
Details for the file govaitextextract-2025.12.21194243-py3-none-any.whl.
File metadata
- Download URL: govaitextextract-2025.12.21194243-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40e8535d4514d5b67a78882b48b2c66f28b897636858877d0bea4a5ef1a53801
|
|
| MD5 |
d71ca482989c44fd2a881abf40952cbb
|
|
| BLAKE2b-256 |
03a80f8d3e5a5e619949323172b175eec65f104a1d7753720c0684a4990ec24e
|