A web application for automatic author recognition from text using deep learning models (LSTM and Transformer). The app provides a FastAPI backend for inference and a Streamlit frontend for user interaction.
app/main.py): Serves /predict/lstm/ and /predict/transformer/ endpoints.app/lstm/lstm_inference.py): Loads LSTM model and weights for inference.app/transformer/transformer_inference.py): Loads Transformer model and weights for inference.app/streamlit_app.py): User interface for uploading text and viewing predictions.Clone the repository:
git clone <repo-url>
cd auto-author-recognition
Install dependencies:
pip install -r requirements.txt
Download/Place Model Weights:
app/lstm/weights/checkpoint_epoch3794_valacc0.72.ptweights folder from the provided Google Drive link and place it inside app/transformer/ so that you have app/transformer/weights/ containing the model files.Run FastAPI backend:
uvicorn app.main:app --reload --port 8000
Run Streamlit frontend (in a new terminal):
streamlit run app/streamlit_app.py
docker build -t auto-author-recognition .
docker run -p 8000:8000 -p 8501:8501 auto-author-recognition
Web UI:
API Endpoints:
POST /predict/lstm/ with JSON { "text": "..." }POST /predict/transformer/ with JSON { "text": "..." }Example using curl:
curl -X POST "http://localhost:8000/predict/lstm/" -H "Content-Type: application/json" -d '{"text": "your text here"}'
app/
main.py # FastAPI app
streamlit_app.py # Streamlit UI
lstm/
lstm_inference.py # LSTM model logic
weights/ # LSTM model weights
transformer/
transformer_inference.py # Transformer model logic
weights/ # Transformer model files
requirements.txt
Dockerfile
architecture.dot # Architecture diagram (Graphviz)
aubmindlab/araelectra-base-discriminator model for embeddings.MIT License
A web application for automatic author recognition from text using deep learning models (LSTM and Transformer). The app provides a FastAPI backend for inference and a Streamlit frontend for user interaction.
app/main.py): Serves /predict/lstm/ and /predict/transformer/ endpoints.app/lstm/lstm_inference.py): Loads LSTM model and weights for inference.app/transformer/transformer_inference.py): Loads Transformer model and weights for inference.app/streamlit_app.py): User interface for uploading text and viewing predictions.Clone the repository:
git clone <repo-url>
cd auto-author-recognition
Install dependencies:
pip install -r requirements.txt
Download/Place Model Weights:
app/lstm/weights/checkpoint_epoch3794_valacc0.72.ptweights folder from the provided Google Drive link and place it inside app/transformer/ so that you have app/transformer/weights/ containing the model files.Run FastAPI backend:
uvicorn app.main:app --reload --port 8000
Run Streamlit frontend (in a new terminal):
streamlit run app/streamlit_app.py
docker build -t auto-author-recognition .
docker run -p 8000:8000 -p 8501:8501 auto-author-recognition
Web UI:
API Endpoints:
POST /predict/lstm/ with JSON { "text": "..." }POST /predict/transformer/ with JSON { "text": "..." }Example using curl:
curl -X POST "http://localhost:8000/predict/lstm/" -H "Content-Type: application/json" -d '{"text": "your text here"}'
app/
main.py # FastAPI app
streamlit_app.py # Streamlit UI
lstm/
lstm_inference.py # LSTM model logic
weights/ # LSTM model weights
transformer/
transformer_inference.py # Transformer model logic
weights/ # Transformer model files
requirements.txt
Dockerfile
architecture.dot # Architecture diagram (Graphviz)
aubmindlab/araelectra-base-discriminator model for embeddings.MIT License