A Flask-based web application for annotating Latin text with linguistic features using spaCy's Latin language model.
- Text Tokenization: Automatically segments Latin text into tokens using spaCy
- Linguistic Annotation: Automatically generates annotations including:
- Part-of-Speech (POS) tags
- Lemmatization
- Morphological features (case, gender, number, aspect, tense, mood, person, voice, verbForm)
- Interactive Editing: Modify generated annotations directly in the web interface
- JSON Export: Save annotations as structured JSON files with timestamps
- Python 3.7+
- Flask 2.3.3
- spaCy 3.5.0
- Additional dependencies listed in
requirements.txt
-
Clone or download the repository
-
Install required packages:
pip install -r requirements.txt
-
Download the Latin language model:
python -m spacy download la_core_web_lg
AnnApi/
├── api/
│ └── main.py # Flask application and core NLP functions
├── templates/
│ └── annotate.html # Web interface template
├── requirements.txt # Python dependencies
└── README.md # This file
-
Start the Flask application:
python api/main.py
-
Open your browser and navigate to
http://localhost:5000 -
Enter Latin text in the text area and click "Annotate"
-
Review and edit the generated annotations as needed
-
Click "Save Modifications as JSON" to export the annotated data
The application uses spaCy's Latin model to tokenize input text into individual tokens.
Each token receives automatic annotations:
- All tokens: POS tag, lemma
- Nouns, adjectives, determiners, pronouns, conjunctions, particles: case, gender, number
- Verbs and auxiliaries: aspect, tense, verbForm, voice, mood, person
Annotations are displayed in an editable form where users can modify any field before saving. Export saves all modified annotations as JSON with a timestamp-based filename.
- Flask: Web framework for creating the web interface
- spaCy: Natural Language Processing library with pre-trained Latin model
- Materialize CSS: Frontend framework for responsive UI
Annotations are saved as JSON with the following structure:
[
{
"token": "word",
"pos": "NOUN",
"lemma": "lemma",
"case": "Nom",
"gender": "Fem",
"number": "Sing",
...
}
]Please see the LICENSE of the application.