1fc1755e7e28e0be952d722edac74f5d26cd78c8,opennmt/models/sequence_tagger.py,,flag_bioes_tags,#Any#Any#Any#,177

Before Change


      gold_tag = gold[b][index]
      pred_tag = predicted[b][index]

      if in_chunk:
        if pred_tag != gold_tag:
          _add_false_negative()
          index = _skip_chunk(gold[b], index)
          in_chunk = False
        elif gold_tag.startswith(b"E"):
          _add_true_positive()
          in_chunk = False
      else:
        if pred_tag == gold_tag:
          if gold_tag == b"O":
            _add_true_negative()
          elif gold_tag.startswith(b"S"):
            _add_true_positive()
          else:
            in_chunk = True
        else:
          if gold_tag == b"O":
            _add_false_positive()
          else:
            _add_false_negative()
            index = _skip_chunk(gold[b], index)

      index += 1

  return np.array(gold_flags), np.array(predicted_flags)

After Change


    while index < length:
      pred_tag = predicted[b][index]
      match, index = _match(predicted[b], gold[b], index, length)
      if not match and pred_tag != b"O":
        _add_false_positive()
      index += 1
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 1fc1755e7e28e0be952d722edac74f5d26cd78c8
Time: 2017-10-25
Author: guillaume.klein@systrangroup.com
File Name: opennmt/models/sequence_tagger.py
Class Name:
Method Name: flag_bioes_tags


Project Name: dask/distributed
Commit Name: 383ea0326ae103b5d5e0b62ed9c3cb18510c5b9e
Time: 2021-02-17
Author: jakirkham@gmail.com
File Name: distributed/comm/tcp.py
Class Name: TCP
Method Name: write


Project Name: quiltdata/quilt
Commit Name: f13d2131c02c6a006a44400850d811c133e3e737
Time: 2018-03-13
Author: aeon.descriptor@gmail.com
File Name: compiler/quilt/test/test_cli.py
Class Name: TestCLI
Method Name: test_cli_option_dev_flag