Skip to content

Commit

Permalink
skipping confusing frames for now
Browse files Browse the repository at this point in the history
  • Loading branch information
chanind committed Apr 30, 2022
1 parent 8856b2e commit 1888b8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frame_semantic_transformer/data/SampleSentence.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ def extract_annotation_target(targets: list[tuple[int, int]]) -> tuple[int, int]
subsequent_target = extract_annotation_target(remaining_targets)
if not subsequent_target:
return None
# until we see a counter-example, assume all multi-word targets are just compount-words with a space between
assert subsequent_target[0] - target[1] == 1
if subsequent_target[0] - target[1] > 1:
# until we see a counter-example, assume all multi-word targets are just compound-words with a space between
target_loc_diff = subsequent_target[0] - target[1]
if target_loc_diff < 0 or target_loc_diff > 1:
return None
return (target[0], subsequent_target[1])

Expand All @@ -68,7 +68,7 @@ def parse_samples_from_annotation_set(
# I don't understand what the second part of this tuple is, just ignore it for now
continue
trigger_loc = extract_annotation_target(annotation["Target"])
# if the trigger loc is weird for some reason just skip it
# if the trigger loc is weird for some reason just skip it for now
if not trigger_loc:
continue
sample_sentences.append(
Expand Down
2 changes: 2 additions & 0 deletions tests/data/test_SampleSentence.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from __future__ import annotations
from syrupy.assertion import SnapshotAssertion
from nltk.corpus import framenet as fn

from frame_semantic_transformer.data.SampleSentence import (
SampleSentence,
parse_samples_from_fulltext_doc,
parse_samples_from_lexical_unit,
)
Expand Down

0 comments on commit 1888b8c

Please sign in to comment.