https://github.com/Libr-AI/OpenFactVerification Skip to content Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} Libr-AI / OpenFactVerification Public * Notifications * Fork 7 * Star 237 * Open-source solution designed to automate the process of verifying factuality www.librai.tech/ License MIT license 237 stars 7 forks Branches Tags Activity Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights Libr-AI/OpenFactVerification This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Last commit Last Name Name message commit date Latest commit History 21 Commits .github/workflows .github/workflows demo_data demo_data factcheck factcheck fig fig static static templates templates .flake8 .flake8 .gitignore .gitignore .pre-commit-config.yaml .pre-commit-config.yaml LICENSE LICENSE README.md README.md factcheck.py factcheck.py requirements.txt requirements.txt webapp.py webapp.py View all files Repository files navigation * README * MIT license LibrAI Logo Loki: An Open-source Tool for Fact Verification Overview Loki is our open-source solution designed to automate the process of verifying factuality. It provides a comprehensive pipeline for dissecting long texts into individual claims, assessing their worthiness for verification, generating queries for evidence search, crawling for evidence, and ultimately verifying the claims. This tool is especially useful for journalists, researchers, and anyone interested in the factuality of information. To stay updated, please subscribe to our newsletter at our website or join us on Discord! Components * Decomposer: Breaks down extensive texts into digestible, independent claims, setting the stage for detailed analysis. * Checkworthy: Assesses each claim's potential significance, filtering out vague or ambiguous statements to focus on those that truly matter. For example, vague claims like "MBZUAI has a vast campus" are considered unworthy because of the ambiguous nature of "vast." * Query Generator: Transforms check-worthy claims into precise queries, ready to navigate the vast expanse of the internet in search of truth. * Evidence Crawler: Ventures into the digital realm, retrieving relevant evidence that forms the foundation of informed verification. * ClaimVerify: Examines the gathered evidence, determining the veracity of each claim to uphold the integrity of information. Quick Start Prerequisites * Python 3.9 or newer * Required Python packages are listed in requirements.txt Installation 1. Clone the repository: git clone https://github.com/Libr-AI/factcheckservice.git 2. Navigate to the project directory and install the required packages: cd factcheckservice pip install -r requirements.txt 3. Configure api keys cp factcheck/config/secret_dict.template factcheck/config/secret_dict.py You can choose to export essential api key to the environment, or configure it in factcheck/config/secret_dict.py. * Example: Export essential api key to the environment export SERPER_API_KEY=... # this is required in evidence retrieval if serper being used export OPENAI_API_KEY=... # this is required in all tasks export ANTHROPIC_API_KEY=... # this is required only if you want to replace openai with anthropic Test [cmd_exampl] To test the project, you can run the factcheck.py script: # String python factcheck.py --modal string --input "MBZUAI is the first AI university in the world" # Text python factcheck.py --modal text --input demo_data/text.txt # Speech python factcheck.py --modal speech --input demo_data/speech.mp3 # Image python factcheck.py --modal image --input demo_data/image.webp # Video python factcheck.py --modal video --input demo_data/video.m4v Usage The main interface of the Fact-check Pipeline is located in factcheck /core/FactCheck.py, which contains the check_response method. This method integrates the complete pipeline, where each functionality is encapsulated in its class as described in the Features section. Example usage: from factcheck.core.FactCheck import check_response # Example text text = "Your text here" # Run the fact-check pipeline results = check_response(text) print(results) Web app usage: python webapp.py [web_input] [web_result] Contributing We welcome contributions from the community! If you'd like to contribute, please follow these steps: 1. Fork the repository. 2. Create a new branch for your feature (git checkout -b feature/ AmazingFeature). 3. Commit your changes (git commit -m 'Add some AmazingFeature'). 4. Push to the branch (git push origin feature/AmazingFeature). 5. Open a pull request. Ready for More? Join Our Journey to Innovation with the Supporter Edition As we continue to evolve and enhance our fact-checking solution, we're excited to invite you to become an integral part of our journey. By registering for our Supporter Edition, you're not just unlocking a suite of advanced features and benefits; you're also fueling the future of trustworthy information. Your support enables us to: Innovate continuously: Develop new, cutting-edge features that keep you ahead in the fight against misinformation. Improve and refine: Enhance the user experience, making our app not just powerful, but also a joy to use. Grow our community: Invest in the resources and tools our community needs to thrive and expand. And as a token of our gratitude, registering now grants you complimentary token credits--a little thank you from us to you, for believing in our mission and supporting our growth! Feature Open-Source Supporter Edition Edition Trustworthy Verification Results Diverse Evidence from the Open Web Automated Correction of Misinformation Privacy and Data Security Multimodal Input One-Stop Custom Solution Customizable Verification Data Sources Enhanced User Experience Faster Efficiency and Higher Accuracy TRY NOW! Stay Connected and Informed Don't miss out on the latest updates, feature releases, and community insights! We invite you to subscribe to our newsletter and become a part of our growing community. Subscribe now at our website! License This project is licensed under the MIT license - see the LICENSE file for details. Acknowledgments * Special thanks to all contributors who have helped in shaping this project. Cite as @misc{Loki, author = {Wang, Hao and Wang, Yuxia and Wang, Minghan and Geng, Yilin and Zhao, Zhen and Zhai, Zenan and Nakov, Preslav and Baldwin, Timothy and Han, Xudong and Li, Haonan}, title = {Loki: An Open-source Tool for Fact Verification}, year = {2024}, publisher = {GitHub}, journal = {GitHub repository}, howpublished = {\url{https://github.com/Libr-AI/Loki}}, } About Open-source solution designed to automate the process of verifying factuality www.librai.tech/ Topics ai hallucination factuality Resources Readme License MIT license Activity Custom properties Stars 237 stars Watchers 2 watching Forks 7 forks Report repository Releases 1 OpenFactVerification v0.0.1 Latest Apr 6, 2024 Packages 0 No packages published Contributors 4 * @HanXudong HanXudong Xudong Han * @haonan-li haonan-li Haonan Li * @yilin-geng yilin-geng Yilin Geng * @Zanebla Zanebla Zane Languages * Python 90.6% * HTML 9.4% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.