{"id":24998736,"url":"https://github.com/mahbub2001/physics-chatbot","last_synced_at":"2026-04-09T23:11:27.989Z","repository":{"id":267343272,"uuid":"900951953","full_name":"Mahbub2001/Physics-Chatbot","owner":"Mahbub2001","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-09T19:23:51.000Z","size":5146,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-29T22:38:15.293Z","etag":null,"topics":["chatbot","chromadb","langchain","llama3","streamlit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mahbub2001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-09T19:14:05.000Z","updated_at":"2024-12-13T15:03:14.000Z","dependencies_parsed_at":"2024-12-09T20:29:00.258Z","dependency_job_id":"2e7ed3dd-c517-4798-8259-14085016379e","html_url":"https://github.com/Mahbub2001/Physics-Chatbot","commit_stats":null,"previous_names":["mahbub2001/physics-chatbot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mahbub2001/Physics-Chatbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mahbub2001%2FPhysics-Chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mahbub2001%2FPhysics-Chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mahbub2001%2FPhysics-Chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mahbub2001%2FPhysics-Chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mahbub2001","download_url":"https://codeload.github.com/Mahbub2001/Physics-Chatbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mahbub2001%2FPhysics-Chatbot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266053838,"owners_count":23869497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","chromadb","langchain","llama3","streamlit"],"created_at":"2025-02-04T18:39:02.256Z","updated_at":"2026-04-09T23:11:27.956Z","avatar_url":"https://github.com/Mahbub2001.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Physics Book Chatbot\n\n## **Physics Book Chatbot**\n\nA physics-focused chatbot application built using **Streamlit** and **LangChain**, designed to answer questions strictly based on a provided physics textbook PDF. The chatbot also includes an evaluation pipeline to measure the quality of its answers using **ROUGE** and **BLEU** metrics. It uses the **Llama 3.1** model for generating accurate, context-based responses.\n\n---\n\n## **Features**\n1. **Physics Chatbot:**\n   - Answers questions based solely on the content of the physics textbook.\n   - Retrieves relevant information using embeddings and a retriever.\n   - Ensures no hallucinated or external information is included in responses.\n\n2. **Llama 3.1 Model:**\n   - Utilizes **Llama 3.1**, a state-of-the-art lightweight LLM optimized for high-quality, context-aware responses.\n\n3. **Evaluation Metrics:**\n   - Supports **ROUGE** (ROUGE-1, ROUGE-2, ROUGE-L) for overlap-based evaluation.\n   - Implements **BLEU** for assessing response accuracy against reference answers.\n   - Automatically processes a set of questions and reference answers for evaluation.\n\n4. **Streamlit Interface:**\n   - Simple and interactive chat interface.\n   - Displays dynamic chatbot responses with a typing effect.\n   - Presents evaluation results in an organized table format.\n\n---\n\n## **Evaluation Metrics**\n\n### **ROUGE**\nMeasures the overlap between chatbot responses and reference answers:\n- **ROUGE-1 F1**: Unigram overlap.\n- **ROUGE-2 F1**: Bigram overlap.\n- **ROUGE-L F1**: Longest common subsequence.\n\n### **BLEU**\nEvaluates the n-gram precision of chatbot responses against reference answers:\n- Scores range from **0** (poor match) to **1** (perfect match).\n\n---\n\n## **Dependencies**\nAll dependencies are listed in `requirements.txt`. Key libraries include:\n- **`streamlit`**: For the interactive web interface.\n- **`langchain`**: For building the chatbot's retrieval-augmented generation (RAG) pipeline.\n- **`chroma-db`**: For vector storage and retrieval.\n- **`nltk`** and **`rouge-score`**: For evaluation metrics.\n- **`Llama 3.1`**: For generating context-aware responses.\n\n---\n\n## **Acknowledgments**\n- **LangChain**: For the framework enabling RAG-based conversational AI.\n- **Ollama**: For the lightweight and efficient LLM used for generating responses.\n- **Streamlit**: For providing an easy-to-use interface for interactive applications.\n\n---\n\n## **Setup and Installation**\n\n### Prerequisites\n- Python 3.8 or higher\n- A physics textbook PDF (`phybook10.pdf`) \n- [Ollama LLM](https://ollama.ai/) running locally\n- **Llama 3.1** installed and ready to serve responses\n\n### Installation Steps\n# Install additional packages using pip\npip install -r requirements.txt\n\n# Run\nstreamlit run emne.py\n\n# Test\nstreamlit run test_emne.py\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahbub2001%2Fphysics-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahbub2001%2Fphysics-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahbub2001%2Fphysics-chatbot/lists"}