Skip to content

chigwell/insightminer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

insightminer

PyPI version License: MIT Downloads LinkedIn

insightminer is a lightweight Python package that extracts and structures key insights from opinionated articles, blog posts, tweets, and other short texts. It leverages the llmatch‑messages library together with a language model (LLM) to parse free‑form input into a predefined, regex‑validated structure, making downstream analysis (sentiment, trend tracking, etc.) straightforward and consistent.


✨ Features

  • One‑function interface – Call insightminer() with your text and get a list of extracted fields.
  • Built‑in LLM – Uses ChatLLM7 from the langchain_llm7 package by default (free tier suitable for most workloads).
  • Pluggable LLM – Pass any LangChain‑compatible chat model (OpenAI, Anthropic, Google, etc.) if you prefer a different provider.
  • Regex‑driven pattern matching – Guarantees that the output conforms to the pattern you define.
  • Simple installation – Available on PyPI.

📦 Installation

pip install insightminer

🚀 Quick Start

from insightminer import insightminer

user_input = "I Wouldn't Want John Solomon's New CMO Job at Mozilla"
results = insightminer(user_input)

print(results)
# Example output: ['John Solomon', 'new CMO job', 'Mozilla']

Parameters

Parameter Type Description
user_input str The text to be processed (e.g., a blog post title, tweet, etc.).
llm Optional[BaseChatModel] A LangChain chat model instance. If omitted, the default ChatLLM7 is used.
api_key Optional[str] API key for LLM7. If omitted, the function reads the LLM7_API_KEY environment variable or falls back to the default key ("None").

🔧 Using a Custom LLM

You can safely replace the default ChatLLM7 with any LangChain‑compatible chat model.

OpenAI

from langchain_openai import ChatOpenAI
from insightminer import insightminer

llm = ChatOpenAI()
response = insightminer("Your text here", llm=llm)
print(response)

Anthropic

from langchain_anthropic import ChatAnthropic
from insightminer import insightminer

llm = ChatAnthropic()
response = insightminer("Your text here", llm=llm)
print(response)

Google Generative AI

from langchain_google_genai import ChatGoogleGenerativeAI
from insightminer import insightminer

llm = ChatGoogleGenerativeAI()
response = insightminer("Your text here", llm=llm)
print(response)

🔑 LLM7 API Key

  • Default behaviour: The function looks for an environment variable LLM7_API_KEY.
  • Providing manually: Pass api_key="YOUR_KEY" when calling insightminer.
  • Free tier: Sufficient for typical usage of this package.
  • Get a key: Register for free at https://token.llm7.io/.

📚 Documentation & References


🐞 Issues & Contributions

If you encounter bugs or have feature requests, please open an issue:

https://github....

Pull requests are welcome! Follow the standard GitHub workflow and ensure tests (if any) pass before submitting.


✉️ Author

Eugene Evstafevhi@euegne.plus
GitHub: chigwell


📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A new package designed to extract and structure key insights from opinionated articles or social media posts. The package takes a text input, such as a blog post or a tweet, and uses llmatch-messages

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages