Views
No views yet
| Dataset | F1 Score | Accuracy |
|---|---|---|
| VUA18 | 0.767 | 0.930 |
| MOH-X | 0.814 | 0.803 |
| TroFi | 0.633 | 0.605 |
pip install transformers torch1from transformers import RobertaTokenizer
2import torch
3
4# Load model and tokenizer
5model_path = "nixie1981/ConceptFrameMet"
6tokenizer = RobertaTokenizer.from_pretrained(model_path)
7
8# Example sentence
9sentence = "The company is navigating through troubled waters"
10target_word = "navigating"
11
12# Predict metaphor with frame and source
13result = predict_metaphor(sentence, target_word)
14
15print(f"Is Metaphor: {result['is_metaphor']}")
16print(f"Confidence: {result['metaphor_confidence']:.2f}")
17print(f"Semantic Frame: {result['frame']}")
18print(f"Source Domain: {result['source']}")Is Metaphor: True
Confidence: 0.92
Semantic Frame: Self_motion
Source Domain: JOURNEYis_metaphor: Boolean indicating if the target is metaphoricalmetaphor_confidence: Confidence score for metaphor prediction (0-1)frame: Predicted semantic frameframe_confidence: Confidence for frame predictionsource: Predicted source domain (for metaphors)source_confidence: Confidence for source prediction1@misc{conceptframemet2026,
2 title={ConceptFrameMet: Metaphor Detection with Frame and Source Domain Prediction},
3 author={Your Name},
4 year={2026},
5 url={https://huggingface.co/YOUR_USERNAME/ConceptFrameMet}
6}