Spaces:
Running
Running
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,10 +1,114 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk:
|
|
|
|
|
|
|
| 7 |
pinned: false
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Agri-Critique Research Assistant
|
| 3 |
+
emoji: πΎ
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: yellow
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 1.28.0
|
| 8 |
+
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# Agri-Critique: Self-Correcting Agricultural QA System
|
| 14 |
+
|
| 15 |
+
## Overview
|
| 16 |
+
|
| 17 |
+
**Agri-Critique** is an evidence-based question-answering system for agricultural research, powered by a fine-tuned Llama 3.1 8B model trained on 2,859 QA pairs with self-correction capabilities.
|
| 18 |
+
|
| 19 |
+
### Key Features
|
| 20 |
+
|
| 21 |
+
- π― **Evidence-Grounded Answers**: All responses cite scientific papers
|
| 22 |
+
- π **Hallucination Detection**: Trained to identify and correct errors
|
| 23 |
+
- π **Critique Mode**: Validate any answer for accuracy and errors
|
| 24 |
+
- π¬ **Conversational**: Maintains context across multiple questions
|
| 25 |
+
- π **Citation-Aware**: Provides paper references for verification
|
| 26 |
+
|
| 27 |
+
### Two Interaction Modes
|
| 28 |
+
|
| 29 |
+
1. **π¬ Q&A Mode**: Ask questions and get evidence-based answers
|
| 30 |
+
2. **π Critique Mode**: Submit a question + proposed answer to validate for:
|
| 31 |
+
- Hallucinations (fake findings)
|
| 32 |
+
- Unsupported claims
|
| 33 |
+
- Temporal/causal errors
|
| 34 |
+
- Missing citations
|
| 35 |
+
|
| 36 |
+
### Model Details
|
| 37 |
+
|
| 38 |
+
- **Base Model**: Llama 3.1 8B Instruct
|
| 39 |
+
- **Fine-tuning**: LoRA (rank=32, alpha=64)
|
| 40 |
+
- **Training Data**:
|
| 41 |
+
- 1,814 standard QA pairs (63.4%)
|
| 42 |
+
- 1,045 adversarial critique pairs (36.6%)
|
| 43 |
+
- **Training Objective**: Mixed curriculum (answer + critique)
|
| 44 |
+
|
| 45 |
+
### Dataset Composition
|
| 46 |
+
|
| 47 |
+
The model was trained on **Agri-Critique**, a novel dataset combining:
|
| 48 |
+
|
| 49 |
+
1. **Standard QA**: Evidence-based agricultural questions
|
| 50 |
+
2. **Adversarial QA**: Intentionally flawed answers with critiques
|
| 51 |
+
- Hallucinations (fake findings)
|
| 52 |
+
- Temporal mismatches
|
| 53 |
+
- Causal reversals
|
| 54 |
+
- Unsupported extrapolations
|
| 55 |
+
|
| 56 |
+
### Research Contribution
|
| 57 |
+
|
| 58 |
+
This system demonstrates:
|
| 59 |
+
- **Self-Correction**: Models can learn to detect their own errors
|
| 60 |
+
- **Citation Integrity**: Reduces "fake citation" problem in RAG systems
|
| 61 |
+
- **Domain Adaptation**: Specialized for agricultural/scientific QA
|
| 62 |
+
|
| 63 |
+
### Usage
|
| 64 |
+
|
| 65 |
+
1. Type your agricultural research question
|
| 66 |
+
2. View the evidence-based answer with citations
|
| 67 |
+
3. Expand "View Evidence Sources" to see paper excerpts
|
| 68 |
+
4. Ask follow-up questions for multi-turn conversation
|
| 69 |
+
|
| 70 |
+
### Example Questions
|
| 71 |
+
|
| 72 |
+
- "What is the effect of nitrogen fertilizer on rice yield?"
|
| 73 |
+
- "How does drought stress affect wheat production?"
|
| 74 |
+
- "What are the benefits of crop rotation?"
|
| 75 |
+
- "Explain the impact of climate change on agriculture."
|
| 76 |
+
|
| 77 |
+
### Limitations
|
| 78 |
+
|
| 79 |
+
- **Domain-Specific**: Optimized for agricultural/scientific questions
|
| 80 |
+
- **Evidence-Dependent**: Answers limited to indexed papers
|
| 81 |
+
- **Not Hallucination-Free**: While reduced, some errors may occur
|
| 82 |
+
- **English Only**: Currently supports English language only
|
| 83 |
+
|
| 84 |
+
### Citation
|
| 85 |
+
|
| 86 |
+
If you use this system in your research, please cite:
|
| 87 |
+
|
| 88 |
+
```bibtex
|
| 89 |
+
@article{agri-critique-2025,
|
| 90 |
+
title={Agri-Critique: Training Self-Correcting Language Models for Agricultural Question Answering},
|
| 91 |
+
author={Your Name},
|
| 92 |
+
journal={arXiv preprint},
|
| 93 |
+
year={2025}
|
| 94 |
+
}
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
### Links
|
| 98 |
+
|
| 99 |
+
- π [Paper](https://arxiv.org/your-paper) (Coming soon)
|
| 100 |
+
- π» [GitHub](https://github.com/your-repo)
|
| 101 |
+
- π€ [Model](https://huggingface.co/your-username/agri-critique-llama)
|
| 102 |
+
- π [Dataset](https://huggingface.co/datasets/your-username/agri-critique)
|
| 103 |
+
|
| 104 |
+
### License
|
| 105 |
+
|
| 106 |
+
MIT License - See LICENSE file for details
|
| 107 |
+
|
| 108 |
+
### Acknowledgments
|
| 109 |
+
|
| 110 |
+
Built with:
|
| 111 |
+
- Llama 3.1 by Meta
|
| 112 |
+
- Hugging Face Transformers
|
| 113 |
+
- FAISS for vector search
|
| 114 |
+
- Streamlit for UI
|