You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to print a Classification report and I get the below error:
I did check if any int values are passed in the list and there were none, infact I also made sure to convert them to string before saving them in a list. Please advise where am I going wrong.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-160-2ad87943346a> in <module>
----> 1 print(classification_report(correctLabels, predLabels))
~\Anaconda3\lib\site-packages\seqeval\metrics\sequence_labeling.py in classification_report(y_true, y_pred, digits, suffix, output_dict, mode, sample_weight, zero_division, scheme)
677 )
678
--> 679 target_names_true = {type_name for type_name, _, _ in get_entities(y_true, suffix)}
680 target_names_pred = {type_name for type_name, _, _ in get_entities(y_pred, suffix)}
681 target_names = sorted(target_names_true | target_names_pred)
~\Anaconda3\lib\site-packages\seqeval\metrics\sequence_labeling.py in get_entities(seq, suffix)
180 chunks = []
181 for i, chunk in enumerate(seq + ['O']):
--> 182 _validate_chunk(chunk, suffix)
183
184 if suffix:
~\Anaconda3\lib\site-packages\seqeval\metrics\sequence_labeling.py in _validate_chunk(chunk, suffix)
168
169 else:
--> 170 if not chunk.startswith(('B-', 'I-', 'E-', 'S-')):
171 warnings.warn('{} seems not to be NE tag.'.format(chunk))
172
AttributeError: 'int' object has no attribute 'startswith'
The text was updated successfully, but these errors were encountered:
I am trying to print a Classification report and I get the below error:
I did check if any int values are passed in the list and there were none, infact I also made sure to convert them to string before saving them in a list. Please advise where am I going wrong.
The text was updated successfully, but these errors were encountered: