Structured TextOutcome Generator: A scalable, instance-and company-specific knowledge base and language model-powered solution that uses Natural Language Processing (NLP), Machine Learning (ML) and Hu
Project description
nlp-structgen
nlp-structgen is a lightweight, instance‑agnostic solution that uses NLP, ML and HCI principles to transform unstructured text into structured JSON (and, in local builds, CSV or plain text). It is ideal for automating repetitive data‑entry tasks, generating business charts, building quotes, converting data, and more, while keeping data consistent and auditable.
Features
- Input validation & consistency checks – ensures the extracted data satisfies a user‑defined regex.
- Template‑driven output – matches a template to produce consistent JSON structures.
- LLM integration – defaults to
ChatLLM7from thelangchain_llm7package, but any LangChain‐compatible model can be provided. - REST / GraphQL – ready to expose via network APIs.
- Logging & performance tracking – logs every invocation and can generate performance charts.
- Export formats – produces JSON by default; local builds can output CSV or plain text.
Installation
pip install nlp_structgen
Quick Start
from nlp_structgen import nlp_structgen
user_input = """
Company: Acme Corp
Employees: 42
Revenue: $5M
"""
results = nlp_structgen(user_input)
print(results) # -> List containing extracted JSON strings
Using a different LLM
If you prefer a different language model you can pass an instance of any BaseChatModel.
Below are three common examples:
OpenAI
from langchain_openai import ChatOpenAI
from nlp_structgen import nlp_structgen
llm = ChatOpenAI() # uses your configured OpenAI key
response = nlp_structgen(user_input, llm=llm)
Anthropic
from langchain_anthropic import ChatAnthropic
from nlp_structgen import nlp_structgen
llm = ChatAnthropic() # uses your configured Anthropic key
response = nlp_structgen(user_input, llm=llm)
Google Gemini
from langchain_google_genai import ChatGoogleGenerativeAI
from nlp_structgen import nlp_structgen
llm = ChatGoogleGenerativeAI()
response = nlp_structgen(user_input, llm=llm)
Customizing the LLM7 API key
nlp_structgen defaults to ChatLLM7.
The free tier rate limits are usually sufficient, but you can provide your own key:
export LLM7_API_KEY="your_api_key_here"
or directly in code:
response = nlp_structgen(user_input, api_key="your_api_key_here")
You can obtain a free key at https://token.llm7.io/.
Parameters
| Parameter | Type | Description |
|---|---|---|
user_input |
str |
Text to process |
api_key |
Optional[str] |
LLM7 API key, if not supplied the environment variable LLM7_API_KEY or the default will be used |
llm |
Optional[BaseChatModel] |
An instance of a LangChain chat model; if omitted, ChatLLM7 will be instantiated |
License
This project is licensed under the MIT license – see the LICENSE file for details.
Author
Eugene Evstafev
Email: hi@euegne.plus
GitHub: chigwell
Contributing
Feel free to open an issue or pull request on https://github.com/chigwell/nlp-structgen/issues.
Disclaimer: All information provided here is based solely on the package’s public code and documentation. No additional facts have been fabricated.
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 nlp_structgen-2025.12.20202749.tar.gz.
File metadata
- Download URL: nlp_structgen-2025.12.20202749.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6ac59ee838209186528c8d1bc1b84e7b510e7074b30b8f19b11826e57fd0197
|
|
| MD5 |
47b5b30e4b2b01e3e58eae7c5ebf3b2c
|
|
| BLAKE2b-256 |
bcf1fcb4cb77d996023174108b3d625b799c20ecc0a4ac0e618c4fdffb284691
|
File details
Details for the file nlp_structgen-2025.12.20202749-py3-none-any.whl.
File metadata
- Download URL: nlp_structgen-2025.12.20202749-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33ec9dea1f21c3b906813494b6848375cec131dae62c2400d0cf6a529d5ca62a
|
|
| MD5 |
49d83cf5615988e82b0b2cf7730489ea
|
|
| BLAKE2b-256 |
31fef0987d3c18f15a5057bcceb85f926b92e82066af7ff09435213a8ea1fbc5
|