How vijaykumar-devcode/documentanalyzer works
Reading Level Analyzer is a Streamlit app that accepts pasted text or uploaded TXT/PDF documents, reports readability statistics, and uses retrieved knowledge-base examples to guide a Gemini reading-level assessment. Its main flow is input extraction, parallel statistics and RAG analysis, then presentation of the score, reasoning, and retrieved sources. The RAG module also builds the local index from curated samples and guidelines. Relationships are based on the excerpts and README; unsampled implementation details are not inferred.
Main entry points: rag_pipeline.py Context Retrieval · app.py Document Extraction · readability_stats.py Readability Statistics · knowledge_base Curated Samples
Components 16
User Interface
- Streamlit Interface
app.py - Text and File Input
app.py - Document Extraction
app.py - Assessment Results
app.py - Retrieved Source Trace
app.py
Readability Analysis
- Readability Statistics
readability_stats.py
RAG Assessment
- Context Retrieval
rag_pipeline.py - Assessment Prompt
rag_pipeline.py - Gemini LLM
- JSON Assessment
rag_pipeline.py
Knowledge Base
- Curated Samples
knowledge_base - Text Loader
rag_pipeline.py - Text Chunking
rag_pipeline.py - Local Embeddings
rag_pipeline.py - FAISS Index
rag_pipeline.py
Other components
- User
Connections 17
- User → Streamlit Interface: uses
README.md - Streamlit Interface → Text and File Input: offers input
app.py - Text and File Input → Document Extraction: extracts text
app.py - Document Extraction → Readability Statistics: measures
app.py - Document Extraction → Context Retrieval: analyzes text
app.py - Curated Samples → Text Loader: loads files
rag_pipeline.py - Text Loader → Text Chunking: splits documents
rag_pipeline.py - Text Chunking → FAISS Index: indexes chunks
rag_pipeline.py - Local Embeddings → FAISS Index: vectorizes documents
rag_pipeline.py - FAISS Index → Context Retrieval: searches index
rag_pipeline.py - Context Retrieval → Assessment Prompt: supplies context
rag_pipeline.py - Assessment Prompt → Gemini LLM: invokes
rag_pipeline.py - Gemini LLM → JSON Assessment: returns response
rag_pipeline.py - Context Retrieval → JSON Assessment: returns chunks
rag_pipeline.py - JSON Assessment → Assessment Results: displays assessment
app.py - JSON Assessment → Retrieved Source Trace: displays sources
app.py - Readability Statistics → Assessment Results: displays metrics
app.py