A web application that generates Telugu question-answer pairs from input text using Python backend with FastAPI and Indic NLP library.
- Telugu Text Processing: Clean and normalize Telugu text input
- Sentence Splitting: Uses Indic NLP library for accurate Telugu sentence segmentation
- Rule-based Q&A Generation: Creates questions based on patterns like years, locations, and keywords
- FastAPI Backend: RESTful API for text processing
- Responsive Frontend: Clean web interface with Telugu language support
- Input Validation: Validates Telugu text quality and length
.
├── app.py # FastAPI backend server
├── telugu_processor.py # Core Telugu NLP processing logic
├── requirements.txt # Python dependencies
├── index.html # Frontend HTML
├── style.css # Frontend styling
├── script.js # Frontend JavaScript (API integration)
├── test_backend.py # Backend testing script
└── todo.md # Implementation progress
pip install -r requirements.txt
python app.py
The server will start on http://localhost:8000
Open index.html
in a web browser or use a local server:
# Using Python's built-in server
python -m http.server 8080
Then navigate to http://localhost:8080
GET /
- API informationGET /health
- Health checkPOST /generate
- Generate Q&A pairs from Telugu textPOST /test
- Test endpoint with sample text
- Enter Telugu text in the textarea (minimum 20 characters)
- Click "ప్రాసెస్ చేయి" (Process) button
- View generated question-answer pairs
తెలంగాణ రాష్ట్రం 2014 లో ఏర్పడింది. హైదరాబాద్ ఈ రాష్ట్ర రాజధాని. రాము ఒక మంచి విద్యార్థి.
1. Q: తెలంగాణ రాష్ట్రం ఏర్పడింది ఎప్పుడు?
A: 2014
2. Q: తెలంగాణ రాష్ట్ర రాజధాని ఏది?
A: హైదరాబాద్
3. Q: రాము ఒక మంచి గురించి ఏమిటి?
A: రాము ఒక మంచి విద్యార్థి.
Run the backend test script:
python test_backend.py
- FastAPI: Web framework for building APIs
- Uvicorn: ASGI server for FastAPI
- indic-nlp-library: NLP library for Indian languages
- nltk: Natural Language Toolkit
- pydantic: Data validation
- The system uses rule-based approach for Q&A generation
- Currently supports year-based and location-based question patterns
- Can be extended with more sophisticated NLP models
- Frontend communicates with backend via REST API
- Add more question templates and patterns
- Integrate machine learning models for better Q&A generation
- Add user authentication and history
- Support for multiple Indian languages
- Export functionality for generated Q&A pairs