chanind / frame-semantic-transformer

Frame Semantic Parser based on T5 and FrameNet
https://chanind.github.io/frame-semantic-transformer
MIT License
54 stars 10 forks source link

Inconsistency with demo_page and local run #28

Closed fatihbozdag closed 1 year ago

fatihbozdag commented 1 year ago

Greetings. It seems like the demo page provides better results than local version. Why is the difference?

For instance, given the sentence "The question of indirect aggression, whether in the form of verbal insults or more subtle antisocial behaviour, has also been studied."

Demo page returns: 
Point_of_dispute
Question
of indirect aggression, whether in the form of verbal insults or more subtle antisocial behaviour,

Scrutiny
Ground
The question of indirect aggression, whether in the form of verbal insults or more subtle antisocial behaviour

However on local version:

from frame_semantic_transformer import FrameSemanticTransformer

frame_transformer = FrameSemanticTransformer()
result = frame_transformer.detect_frames("The question of indirect aggression, whether in the form of verbal insults or more subtle antisocial behaviour, has also been studied.    ")
print(f"Results found in: {result.sentence}")
for frame in result.frames:
    print(f"FRAME: {frame.name}")
    for element in frame.frame_elements:
        print(f"{element.name}: {element.text}: Trigger Location: {frame.trigger_location}")
Results found in: The question of indirect aggression, whether in the form of verbal insults or more subtle antisocial behaviour
FRAME: Point_of_dispute
Question: of indirect aggression, whether in the form of verbal insults or more subtle antisocial behaviour: Trigger Location: 4

DetectFramesResult(sentence='The question of indirect aggression, whether in the form of verbal insults or more subtle antisocial behaviour', trigger_locations=[4], frames=[FrameResult(name='Point_of_dispute', trigger_location=4, frame_elements=[FrameElementResult(name='Question', text='of indirect aggression, whether in the form of verbal insults or more subtle antisocial behaviour')])])

frame-semantic-transformer-0.10.0

fatihbozdag commented 1 year ago

edit: Well it was my mistake, sorry for the confusion. Both provide the same results.