Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Single layer classifier evaluator #1385

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Fraser-Greenlee
Copy link

Resolves: #1380

Uses an sklearn single layer perceptron trained on a set of sentence embeddings and class labels.

The classifier accuracy indicates how good the semantic encoding is.

This could be used to evaluate a semantic encoders performance on a range of classification task while it trains.

@Fraser-Greenlee Fraser-Greenlee changed the title Draft: Single layer classifier evaluator Single layer classifier evaluator Jan 18, 2022
def test_SingleLayerClassificationEvaluator(self):
"""Tests that the SingleLayerClassificationEvaluator can loads and runs with reasonable performance."""
model = SentenceTransformer('paraphrase-distilroberta-base-v1')
df = pd.read_csv('datasets/ag_news.csv')[:1_000]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fraser-Greenlee Fraser-Greenlee changed the title Single layer classifier evaluator Draft: Single layer classifier evaluator Jan 20, 2022
@Jacobluke-
Copy link

Hi! I'm also very interested in creating more evaluator for testing downstream tasks. I tried creating a similar evaluator like yours by using an sklearn single layer perceptron for regression. The score of sklearn MLPRegressor is R2 score, which might not be useful because it sometimes gets a negative result. Do you have a better idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: SingleLayerClassificationEvaluator.
2 participants