Hameed13 commited on
Commit
9c40f33
Β·
1 Parent(s): 889d4df

Add application file

Browse files
Files changed (5) hide show
  1. .gitignore +15 -0
  2. LICENCE +21 -0
  3. README.md +38 -11
  4. client.py +35 -0
  5. requirements.txt +17 -0
.gitignore ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ignore virtual environments
2
+ venv/
3
+ myenv/
4
+ env/
5
+
6
+ # Ignore compiled Python files
7
+ __pycache__/
8
+ *.pyc
9
+ *.pyo
10
+
11
+ # Ignore Jupyter Notebook checkpoints
12
+ .ipynb_checkpoints/
13
+
14
+ # Ignore environment variables file
15
+ .env
LICENCE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Abdulhameed
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the β€œSoftware”), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED β€œAS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md CHANGED
@@ -1,14 +1,41 @@
 
 
 
 
1
  ---
2
- title: VeraCT Scan News Verification System
3
- emoji: πŸ“‰
4
- colorFrom: pink
5
- colorTo: red
6
- sdk: streamlit
7
- sdk_version: 1.44.1
8
- app_file: app.py
9
- pinned: false
10
- license: mit
11
- short_description: 'This system doesn’t just scan newsβ€”it investigates. Type in '
 
12
  ---
13
 
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 🧠 VeraCT Scan-like Fake News Detection System
2
+
3
+ A powerful, AI-enhanced news verification API that analyzes the credibility of news content by cross-referencing reliable sources, extracting entities, and applying reasoning from large language models. Built with FastAPI, LangChain, Groq's LLaMA-4 model, spaCy, and multiple real-time search APIs.
4
+
5
  ---
6
+
7
+ ## πŸš€ Key Features
8
+
9
+ - βœ… **Headline & Content Verification** using LLM + multi-source matching
10
+ - 🌐 **Reliable Domain Detection** from over 600+ trusted sources
11
+ - 🧠 **LLM Verdict Generation** (VERIFIED, LIKELY FAKE, or REQUIRES MORE VERIFICATION)
12
+ - πŸ” **Entity Extraction** with spaCy (ORG, PERSON, EVENT, etc.)
13
+ - πŸ›‘οΈ **Cross-checking** with [SearchAPI](https://www.searchapi.io/) and [Tavily](https://www.tavily.com/)
14
+ - πŸ” **.env-based API Key Security**
15
+ - πŸ§ͺ API Testing endpoints for dev setup
16
+
17
  ---
18
 
19
+ ## 🧩 Tech Stack
20
+
21
+ - **Python 3.10+**
22
+ - **FastAPI**
23
+ - **LangChain + Groq LLaMA-4**
24
+ - **spaCy (NER & NLP)**
25
+ - **SearchAPI + Tavily**
26
+ - **Pydantic + CORS middleware**
27
+ - **Uvicorn (ASGI server)**
28
+
29
+ - ## πŸ›‘οΈ License
30
+
31
+ This project is licensed under the [MIT License](LICENSE).
32
+
33
+ ---
34
+
35
+ ## βš™οΈ Setup Instructions
36
+
37
+ ### 1. Clone the repository
38
+
39
+ ```bash
40
+ git clone https://github.com/Abdulhameed556/VeraCT_Scan-like_news_verification_system_1.git
41
+ cd VeraCT_Scan-like_News_Verification_System
client.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import requests
3
+
4
+ st.set_page_config(page_title="AI News Verifier", layout="centered")
5
+
6
+ st.title("πŸ“° AI-Powered News Verification")
7
+ st.write("Check if a news headline and content are truthful based on reliable sources using AI.")
8
+
9
+ # Input fields
10
+ headline = st.text_input("πŸ—žοΈ News Headline", "")
11
+ content = st.text_area("🧾 News Content", "")
12
+
13
+ if st.button("πŸ” Verify News"):
14
+ if not headline or not content:
15
+ st.warning("⚠️ Please enter both a headline and content.")
16
+ else:
17
+ api_url = "https://news-web-application-ai-news-detector.onrender.com/verify" # <- Make sure this matches your FastAPI route
18
+
19
+ payload = {"headline": headline, "content": content}
20
+
21
+ try:
22
+ response = requests.post(api_url, json=payload)
23
+
24
+ if response.status_code == 200:
25
+ result = response.json()
26
+ st.success("βœ… News verification completed.")
27
+ st.subheader("🧠 AI Verdict")
28
+ st.markdown(f"**Verdict:** {result['verdict']}")
29
+ st.markdown("**LLM Analysis:**")
30
+ st.write(result['llm_response'])
31
+ else:
32
+ st.error(f"❌ Server responded with status code {response.status_code}. Please try again.")
33
+
34
+ except requests.exceptions.RequestException as e:
35
+ st.error(f"🚫 Request failed: {e}")
requirements.txt ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ langserve
2
+ fastapi
3
+ uvicorn
4
+ sse_starlette
5
+ bs4
6
+ pypdf
7
+ chromadb
8
+ faiss-cpu
9
+ wikipedia
10
+ arxiv
11
+ langchainhub
12
+ groq
13
+ streamlit
14
+ sentence_transformers
15
+ transformers
16
+ langchain_community
17
+ langchain_groq