
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
fin-sentiment
Advanced tools
Financial News Sentiment Analysis using LSTM
fin-sentiment is a Python package that analyzes the sentiment of financial news headlines using an LSTM-based deep learning model. It helps traders, investors, and analysts gauge market sentiment by classifying news as positive, neutral, or negative.
pip install fin-sentiment
from fin_sentiment.news_fetcher import fetch_company_news
from fin_sentiment.analyzer import SentimentAnalyzer
# Step 1: Fetch latest news for a company
news = fetch_company_news("TCS", limit=10)
# Step 2: Initialize sentiment analyzer
analyzer = SentimentAnalyzer()
# Step 3: Analyze each news headline
for article in news:
sentiment = analyzer.analyze(article["title"])
print(f"{article['title']} → {sentiment}")
# Step 4: Get overall market sentiment
overall = analyzer.overall_sentiment(news)
print(f"Market Mood: {overall}")
# Step 5: Analyze a custom headline
custom_sentiment = analyzer.analyze("Stock prices surged after positive earnings report")
print(custom_sentiment) # Output: positive
fin_sentiment.news_fetcherfetch_company_news(company_name: str, limit: int = 10) -> listFetches the latest news headlines for a specified company from financial sources.
Parameters:
company_name (str): Name of the company to fetch news forlimit (int): Maximum number of headlines to retrieve (default: 10)Returns: List of news articles with titles and metadata
Example:
news = fetch_company_news("Infosys", limit=5)
fin_sentiment.analyzerSentimentAnalyzer()Initializes the LSTM-based sentiment analysis model.
Example:
analyzer = SentimentAnalyzer()
.analyze(text: str) -> strAnalyzes the sentiment of a single text string.
Parameters:
text (str): The headline or text to analyzeReturns: Sentiment label: "positive", "neutral", or "negative"
Example:
sentiment = analyzer.analyze("Company shares hit record high")
print(sentiment) # Output: positive
.overall_sentiment(news_list: list) -> strAggregates sentiment across multiple news headlines to determine overall market mood.
Parameters:
news_list (list): List of news articles (with "title" key)Returns: Overall sentiment: "positive", "neutral", or "negative"
Example:
overall = analyzer.overall_sentiment(news)
print(overall) # Output: neutral
TCS shares rise 5% after strong Q3 results → positive
TCS faces data breach allegations → negative
TCS announces dividend payout → positive
Market closes flat amid mixed signals → neutral
Market Mood: neutral
| Property | Details |
|---|---|
| Architecture | LSTM (Long Short-Term Memory) |
| Framework | PyTorch |
| Dataset | Financial headlines from multiple market sources |
| Classes | Positive, Neutral, Negative |
| Output | Softmax probability distribution → final label |
Contributions are welcome! Please feel free to submit a Pull Request.
FAQs
Financial news sentiment analysis using LSTM
We found that fin-sentiment demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.