Instructions to use MarcusBennevall/sentence-function-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use MarcusBennevall/sentence-function-classifier with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("MarcusBennevall/sentence-function-classifier") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Sentence Function Classifier
This model classifies English sentences as: declarative, exclamatory, imperative, interrogative, optative.
It embeds sentences with sentence-transformers/all-MiniLM-L6-v2 and predicts the final
class with a logistic regression classifier trained on a balanced seed dataset.
Intended Use
This is designed for educational demos and lightweight sentence-function analysis. It is not intended as a grammar authority for high-stakes assessment.
Evaluation
- Dataset size: 125
- Held-out test split: 0.2
- Accuracy: 0.760
The seed dataset is small, so the metrics should be treated as a smoke test rather than a final benchmark.