How ameyaranadee/automatic-short-answer-grading works
Project type and purpose
• From the file tree and README, this is a Python‑based machine‑learning pipeline (“Automatic Short Answer Grading”) for scoring student free‑text answers using feature extraction and regression models.
• It is not a web or microservices app but an ML experimentation/training tool with clear pipeline stages.
File structure
• Top‑level modules:
• args.py – CLI argument parsing
• preprocessing.py – text normalization and spelling correction
• embeddings.py – loading Baroni embeddings into memory
• feature_extraction.py – computing similarity‑based features
• run.py & main.sh – orchestration scripts to execute the full pipeline
• Data directories:
• data/ – raw CSVs (Data.csv, QA1.csv) and downloaded embeddings file
• downloads/ – intermediate processed files (combined_final_features.csv, etc.)
• requirements.txt – lists Python libraries (e.g., scikit‑learn, NLTK, fuzzywuzzy, python‑Levenshtein)
• No separate “models/” folder, but training outputs and logs likely live in “downloads/”
README for architecture hints
• Pipeline stages: Preprocessing → Feature Extraction → Train/Test split → Model Training/Evaluation
• External dependencies: Baroni embeddings, NLTK’s WordNet, a spellchecker library
a. Main components
• Data Sources
– Raw Student Answers & Reference Answers (data/Data.csv, QA1.csv)
– Pre‑trained Word Embeddings (data/EN‑wform…txt)
• Preprocessing Module (preprocessing.py)
– Text cleaning, tokenization, stop‑word removal, spell‑correction via WordNet & spellchecker
• Embedding Loader (embeddings.py)
– Loads CBOW vectors into in‑memory lookup structure
• Feature Extraction Module (feature_extraction.py)
– Computes cosine similarity, alignment score, length ratio, Euclidean distance, fuzzy matches
• Model Training & Evaluation Module (run.py & main.sh)
– Data split (75/25), trains Random Forest, Ridge, Neural Net regressors, outputs predictions
• Outputs
– Processed feature CSVs (downloads/feature_df.csv, processed_df.csv)
– Final model performance metrics and trained model artifacts
b. Relationships & data flow
1. Raw CSVs + Embeddings → Preprocessing Module
2. Preprocessed text → Embedding Loader → Feature Extraction
3. Features → Train/Test Split → Model Training
4. Trained Models → Predictions → Evaluation reports
c. Architectural patterns/design principles
• Modular pipeline: each stage is a separate Python module
• Data separation: raw data, intermediate feature files, final outputs
• Reproducibility: orchestrated via main.sh and run.py
d. Relevant technologies/frameworks
• Python 3.x, pandas, scikit‑learn, NLTK, fuzzywuzzy, python‑Levenshtein
Key points to ensure detail
• Intermediate artifact files in “downloads/” as outputs of specific modules