Skip to content

Commit

Permalink
black formatting and ruff fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Fuchs committed Jul 17, 2023
1 parent e93a75f commit 7f79e92
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion flair/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ def to_dict(self, tag_type: Optional[str] = None):
"labels": [label.to_dict() for label in self.get_labels(tag_type) if label.data_point is self],
"entities": [span.to_dict(tag_type) for span in self.get_spans(tag_type)],
"relations": [relation.to_dict(tag_type) for relation in self.get_relations(tag_type)],
"tokens": [token.to_dict(tag_type) for token in self.tokens]
"tokens": [token.to_dict(tag_type) for token in self.tokens],
}

def get_span(self, start: int, stop: int):
Expand Down
7 changes: 1 addition & 6 deletions flair/training_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,7 @@ def micro_avg_f_score(self):
return self.mean_squared_error()

def to_tsv(self):
return "{}\t{}\t{}\t{}".format(
self.mean_squared_error(),
self.mean_absolute_error(),
self.pearsonr(),
self.spearmanr(),
)
return f"{self.mean_squared_error()}\t{self.mean_absolute_error()}\t{self.pearsonr()}\t{self.spearmanr()}"

@staticmethod
def tsv_header(prefix=None):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ignore = [
"D105",
"D107",
"E501", # Ignore line too long
"RUFF012",
"RUF012",
]

unfixable = [
Expand Down

0 comments on commit 7f79e92

Please sign in to comment.