Add URL Input Support for Fact-Checking#105
Merged
Deepika14145 merged 1 commit intoOct 14, 2025
Merged
Conversation
|
@Akash6299625764 is attempting to deploy a commit to the deepika's projects Team on Vercel. A member of the Team first needs to authorize it. |
Owner
|
What is your issue id?? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the ability for the FactChecker API to accept a URL in addition to plain text.
Changes included:
Added utils/fetch_url.py to fetch and extract text content from web pages.
Updated /predict and /predict_all endpoints to handle an optional "url" key.
If a URL is provided, the text is fetched and passed to the fact-checker; otherwise, text input is used.
Preserves existing prediction logic and backward compatibility.
How to test:
Run the Flask app locally:
python app.py
Send a POST request with JSON body:
Text input: {"text": "Some news text"}
URL input: {"url": "https://example.com/article"}
Verify JSON response contains prediction, confidence, message, and analysis.
Benefit:
Allows users to quickly check the authenticity of online articles via URL.
Enhances usability and lays the groundwork for future front-end improvements.