Similarity, Simplified.
AI-powered duplicate news detection system built using NLP and TF-IDF similarity scoring.
Similify helps detect highly similar or duplicate articles instantly with accurate similarity scores.
Similify is an intelligent content similarity detection system designed to:
- Detect duplicate or near-duplicate news articles
- Calculate similarity scores using TF-IDF + Cosine Similarity
- Help publishers maintain originality
- Prevent repeated content publishing
- Improve editorial quality control
The system exposes a FastAPI backend and can be integrated with web or mobile applications.
- Clean and preprocess text
- Convert text into TF-IDF vectors
- Compare new article with stored articles
- Calculate cosine similarity score
- Flag as duplicate if similarity โฅ threshold
Similify/
โ
โโโ app.py # FastAPI application
โโโ clean_data.csv # Preprocessed articles dataset
โโโ tfidf_matrix.pkl # Stored TF-IDF matrix
โโโ vectorizer.pkl # Saved TF-IDF vectorizer
โโโ utils.py # Cleaning + similarity functions
โโโ requirements.txt # Dependencies
โโโ README.md
- Python
- FastAPI
- Scikit-learn
- Pandas
- NumPy
- TF-IDF Vectorizer
- Cosine Similarity
- Uvicorn
- Ngrok (for public API testing)
- ๐ Real-time article similarity detection
- ๐ Similarity score percentage output
- ๐จ Duplicate threshold control (default: 0.80 / 0.85)
- ๐งน Custom NLP cleaning pipeline
- โก FastAPI REST API
- ๐ Ngrok public endpoint support
- ๐ CSV-based dataset support
- ๐ TF-IDF pre-trained model loading
- ๐ฐ News Agencies (duplicate detection)
- ๐ข Content Publishing Platforms
- ๐ Academic Plagiarism Checking
- ๐ Product Description Similarity Check
- ๐ค AI Content Validation Systems
- ๐งพ Media Monitoring Systems
- Prevents duplicate content publishing
- Saves editorial review time
- Improves content credibility
- Maintains SEO quality
- Scalable to millions of documents
- Lightweight and cost-effective solution
Similify also includes a React Native mobile application that connects to the FastAPI backend for real-time duplicate detection.
Before running the mobile app, make sure you have installed:
- Node.js (LTS version recommended)
- npm or yarn
- Android Studio (for Android development)
- Xcode (Mac only โ for iOS development)
- React Native CLI or Expo CLI (depending on your setup)
Verify installation:
node -v
npm -vNavigate to the mobile app directory:
cd similify-app
npm installnpx react-native startMake sure Android Emulator is running OR a physical device is connected.
npx react-native run-androidnpx react-native run-iosUpdate the API base URL inside your project:
const BASE_URL = "http://127.0.0.1:8000";If using Android Emulator, use:
const BASE_URL = "http://10.0.2.2:8000";If using a real physical device, use your systemโs local IP address:
const BASE_URL = "http://192.168.X.X:8000";To find your local IP:
ipconfig # Windows
ifconfig # macOS/LinuxStart backend:
uvicorn app:app --reloadStart ngrok:
ngrok http 8000Copy the generated HTTPS URL and update:
const BASE_URL = "https://your-ngrok-url.ngrok.io";npx react-native start --reset-cacherm -rf node_modules
npm installgit clone https://github.com/shabbir0000/Similify_Model.gitpython -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windowspip install -r requirements.txtuvicorn app:app --reloadServer will start at:
http://127.0.0.1:8000
Install ngrok and run:
ngrok http 8000You will get a public HTTPS URL like:
https://abcd1234.ngrok.io
Use this URL in your frontend/mobile app.
{
"text": "string",
"top_n": 5
}{
"is_duplicate": true,
"results": [
{
"article_id": 101,
"title": "Sample News Title",
"similarity_score": 0.87,
"url": "https://example.com"
}
]
}Default threshold: 0.80
You can modify it inside:
duplicate_threshold = 0.80Recommended range:
- 0.75 โ Loose matching
- 0.80 โ Balanced (Recommended)
- 0.85 โ Strict duplicate detection
- Semantic similarity using Transformers (BERT)
- Elasticsearch integration
- MongoDB support
- Real-time streaming comparison
- Admin dashboard
- Similarity heatmap visualization
Muhammad Shabbir
AI Engineer | NLP & AI Automation Specialist
IBM Certified AI Professional