Skip to content

Commit

Permalink
GH-2717: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alanakbik committed Apr 10, 2022
1 parent e14ab53 commit 78b17f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions flair/datasets/sequence_labeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ def _convert_lines_to_sentence(
for span_indices, score, label in predicted_spans:
span = sentence[span_indices[0] : span_indices[-1] + 1]
value = self._remap_label(label)
if value != 'O':
if value != "O":
span.add_label(span_level_tag_columns[span_column], value=value, score=score)
except Exception:
pass
Expand All @@ -683,7 +683,7 @@ def _convert_lines_to_sentence(
first=sentence[head_start - 1 : head_end], second=sentence[tail_start - 1 : tail_end]
)
remapped = self._remap_label(label)
if remapped != 'O':
if remapped != "O":
relation.add_label(typename="relation", value=remapped)

if len(sentence) > 0:
Expand Down Expand Up @@ -722,7 +722,7 @@ def _parse_token(self, line: str, column_name_map: Dict[int, str], last_token: O
# add each other feature as label-value pair
label_name = feature.split("=")[0]
label_value = self._remap_label(feature.split("=")[1])
if label_value != 'O':
if label_value != "O":
token.add_label(label_name, label_value)

else:
Expand All @@ -731,7 +731,7 @@ def _parse_token(self, line: str, column_name_map: Dict[int, str], last_token: O
# get the label value
label_value = self._remap_label(fields[column])
# add label
if label_value != 'O':
if label_value != "O":
token.add_label(label_name, label_value)

if column_name_map[column] == self.SPACE_AFTER_KEY and fields[column] == "-":
Expand Down

0 comments on commit 78b17f2

Please sign in to comment.