https://github.com/chigwell/text2structured-summary
text2structured-summary generates structured summaries from unstructured text using an LLM.
https://github.com/chigwell/text2structured-summary
automated-summarization content-structuring educational-content-integration information-organization knowledge-extraction llm-response-variability-handling llm-summarization pattern-adherence retries-and-diagnostics structured-output-generation text-analysis unstructured-text-processing
Last synced: 3 months ago
JSON representation
text2structured-summary generates structured summaries from unstructured text using an LLM.
- Host: GitHub
- URL: https://github.com/chigwell/text2structured-summary
- Owner: chigwell
- Created: 2025-12-21T18:34:42.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-12-21T18:35:04.000Z (4 months ago)
- Last Synced: 2025-12-23T07:35:58.889Z (4 months ago)
- Topics: automated-summarization, content-structuring, educational-content-integration, information-organization, knowledge-extraction, llm-response-variability-handling, llm-summarization, pattern-adherence, retries-and-diagnostics, structured-output-generation, text-analysis, unstructured-text-processing
- Language: Python
- Homepage: https://pypi.org/project/text2structured-summary/
- Size: 2.93 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# text2structured_summary
[](https://badge.fury.io/py/text2structured-summary)
[](https://opensource.org/licenses/MIT)
[](https://pepy.tech/project/text2structured-summary)
[](https://www.linkedin.com/in/eugene-evstafev-716669181/)
Generate structured summaries from unstructured text using an LLM.
## Installation
```bash
pip install text2structured_summary
```
## Usage
```python
from text2structured_summary import text2structured_summary
# Basic usage with default LLM7
response = text2structured_summary(
user_input="Your unstructured text here..."
)
# With custom LLM (e.g., OpenAI)
from langchain_openai import ChatOpenAI
from text2structured_summary import text2structured_summary
llm = ChatOpenAI()
response = text2structured_summary(
user_input="Your unstructured text...",
llm=llm
)
# With custom API key (LLM7)
response = text2structured_summary(
user_input="Your unstructured text...",
api_key="your_llm7_api_key"
)
```
## Parameters
- `user_input` (str): The unstructured text to be summarized
- `api_key` (Optional[str]): LLM7 API key (defaults to environment variable `LLM7_API_KEY`)
- `llm` (Optional[BaseChatModel]): Custom LangChain LLM instance (defaults to ChatLLM7)
## Features
- Uses LLM7 by default (free tier sufficient for most use cases)
- Supports custom LLMs via LangChain interface
- Returns structured summaries matching predefined pattern
- Automatic API key fallback from environment variables
## Getting Started
1. Install the package
2. Call `text2structured_summary()` with your text
3. Get structured output matching the package's pattern
## Notes
- For LLM7, register at [https://token.llm7.io/](https://token.llm7.io/) for your API key
- The default pattern ensures structured output format
- Custom LLMs must implement LangChain's BaseChatModel interface
## Issues
Report issues at: [https://github.com/chigwell/text2structured-summary/issues](https://github.com/chigwell/text2structured-summary/issues)
## Author
Eugene Evstafev (hi@euegne.plus)