Skip to main content

Tech Sentiment Analyzer

PyPI version License: MIT Downloads LinkedIn

A Python package for analyzing text input to determine sentiment intensity and polarity toward specific tech CEOs or companies. It provides structured scores and rankings with confidence metrics, ensuring consistent output through pattern matching.


📦 Installation

Install the package via pip:

pip install tech_sentiment_analyzer

✨ Features

  • Sentiment Analysis: Extracts sentiment intensity and polarity for tech-related entities (CEOs, companies).
  • Structured Output: Returns standardized scores and confidence metrics.
  • Pattern Matching: Ensures consistent output format via regex validation.
  • Flexible LLM Integration: Works with default ChatLLM7 or custom LLMs (OpenAI, Anthropic, Google, etc.).
  • No External Data Access: Processes only user-provided text (no API calls to external sources).

🚀 Usage

Basic Usage (Default LLM7)

from tech_sentiment_analyzer import tech_sentiment_analyzer

response = tech_sentiment_analyzer(
    user_input="Elon Musk's recent tweets show mixed sentiment about SpaceX's Mars mission."
)
print(response)

Custom LLM Integration

Using OpenAI:

from langchain_openai import ChatOpenAI
from tech_sentiment_analyzer import tech_sentiment_analyzer

llm = ChatOpenAI()
response = tech_sentiment_analyzer(
    user_input="Satya Nadella's leadership at Microsoft has been widely praised.",
    llm=llm
)
print(response)

Using Anthropic:

from langchain_anthropic import ChatAnthropic
from tech_sentiment_analyzer import tech_sentiment_analyzer

llm = ChatAnthropic()
response = tech_sentiment_analyzer(
    user_input="Tim Cook's focus on privacy at Apple has sparked debates.",
    llm=llm
)
print(response)

Using Google Generative AI:

from langchain_google_genai import ChatGoogleGenerativeAI
from tech_sentiment_analyzer import tech_sentiment_analyzer

llm = ChatGoogleGenerativeAI()
response = tech_sentiment_analyzer(
    user_input="Sundar Pichai's vision for Google's AI future is ambitious.",
    llm=llm
)
print(response)

🔧 Parameters

Parameter Type Description
user_input str The text input to analyze for sentiment.
api_key Optional[str] LLM7 API key (defaults to LLM7_API_KEY environment variable).
llm Optional[BaseChatModel] Custom LLM instance (e.g., ChatOpenAI, ChatAnthropic). Defaults to ChatLLM7.

🔑 API Key & Rate Limits

  • Default LLM: Uses ChatLLM7 (from langchain_llm7).
  • Free Tier: Sufficient for most use cases (check LLM7 docs for limits).
  • Custom API Key: Pass via api_key parameter or LLM7_API_KEY environment variable:
    response = tech_sentiment_analyzer(
        user_input="Example text...",
        api_key="your_llm7_api_key"
    )
    

📝 Output Format

The function returns a list of structured sentiment scores (e.g., polarity, intensity, confidence) extracted via regex-matching. Example output:

[
    {"entity": "Elon Musk", "polarity": "positive", "intensity": 0.85, "confidence": 0.92},
    {"entity": "SpaceX", "polarity": "neutral", "intensity": 0.30, "confidence": 0.88}
]

🛠️ Development & Support


🔗 References

Metadata

Release files for tech-sentiment-analyzer 2025.12.21152823

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tech-sentiment-analyzer 2025.12.21152823
File Size Uploaded
tech_sentiment_analyzer-2025.12.21152823.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tech-sentiment-analyzer 2025.12.21152823
File Interpreter ABI Platform
tech_sentiment_analyzer-2025.12.21152823-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 kB

Release files / tech_sentiment_analyzer-2025.12.21152823.tar.gz

Download URL tech_sentiment_analyzer-2025.12.21152823.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b31dc0334292d07e9f7f8f4b19230bde00e9bea496e50d17fd184afc27dc3f50
BLAKE2b-256 checksum
How to use checksums
fb16f14cda41b62dfe9f173c43cb62b936a13bce2462bdfe67ebd47f2873f9c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / tech_sentiment_analyzer-2025.12.21152823-py3-none-any.whl

Download URL tech_sentiment_analyzer-2025.12.21152823-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1af55b261eb5d28633ca717b8a07a8cc8f52e8f1a43feff95b2482374f8b8227
BLAKE2b-256 checksum
How to use checksums
da0d95b98bd68d1c89693bb0c7e21ae57469e073eee3d00d09a2c9d8a0ae8ab6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

2025.12.21152823 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page