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

BertScore metric #1

Merged
merged 2 commits into from
May 12, 2023
Merged

BertScore metric #1

merged 2 commits into from
May 12, 2023

Conversation

shahules786
Copy link
Member

Add support for BertScore metrics using sentence Bert transformers.

Comment on lines +24 to +29

def name(self,):
return f"SBERT-{self.similarity_metric}-score"

def is_batchable(self):
return True
Copy link
Member

Choose a reason for hiding this comment

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

add @Property

def is_batchable(self):
return True

def score(self, ground_truth: t.Union[str, t.List[str]], generated_text: t.Union[str, t.List[str]]):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def score(self, ground_truth: t.Union[str, t.List[str]], generated_text: t.Union[str, t.List[str]]):
def score(self, ground_truth: str | t.Sequence[str], generated_text: str | t.Sequence[str]):

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.

2 participants