-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
collect formatting tests for flair package #2611
collect formatting tests for flair package #2611
Conversation
…all_formattings # Conflicts: # flair/embeddings/base.py # flair/training_utils.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many improvements in code readability and bug fixes. Thanks a lot!
@@ -924,7 +924,15 @@ def to_dict(self, tag_type: str = None): | |||
|
|||
return {"text": self.to_original_text(), "all labels": labels} | |||
|
|||
def __getitem__(self, subscript: int) -> Union[Token, Span]: | |||
@typing.overload | |||
def __getitem__(self, idx: int) -> Token: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow cool construct, I had no idea one could do this!
@@ -1375,7 +1375,7 @@ def __init__( | |||
|
|||
super(WSD_RAGANATO_ALL, self).__init__( | |||
data_folder=data_folder, | |||
columns=columns, | |||
column_format=columns, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for spotting and fixing this!
for predicted_span in predicted_spans: | ||
span = Span(sentence[predicted_span[0][0] : predicted_span[0][-1] + 1]) | ||
value = self._remap_label(predicted_span[2]) | ||
for span_indices, score, label in predicted_spans: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much better readability
@@ -489,10 +489,12 @@ def __init__(self, tokens: List[Token]): | |||
|
|||
@property | |||
def start_pos(self) -> int: | |||
assert self.tokens[0].start_position is not None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity: why are these asserts necessary?
@helpmefindaname thanks a lot for these many improvements! |
I have noticed, that my local pytest fails on master due to mypy and flake8 errors but run trough in cicd.
This is an atempt to fix it, so we have a faster feedback loop