File size: 3,230 Bytes
1b12abd
 
 
 
 
 
68a54cd
1b12abd
 
 
 
 
68a54cd
 
1b12abd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68a54cd
 
 
1b12abd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68a54cd
1b12abd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# ConceptFrameMet: Metaphor Detection with Frame and Source Domain Prediction

**A comprehensive metaphor detection model that predicts semantic frames and source domains**

## Model Description

ConceptFrameMet is a metaphor detection model which not only detects metaphors but also predicts:

1. **Metaphor Classification**: Whether a target word is used metaphorically or literally
2. **Semantic Frames**: The conceptual frame evoked by the target word
3. **Source Domains**: The source domain of the metaphor (for metaphorical uses)

Please see https://github.com/julia-nixie/ConceptFrameMet and PAPER LINK for details.

## Model Architecture

- **Base Model**: RoBERTa-base
- **Architecture**: MelBERT with adaptive source domain integration
- **Training Data**: VUA18 metaphor corpus
- **Configuration**:
  - Source blend mode: replacement
  - Source use mode: metaphor_only
  - Metaphor threshold: 0.5

## Performance

Evaluated on standard metaphor detection benchmarks:

| Dataset | F1 Score | Accuracy |
|---------|----------|----------|
| VUA18   | 0.767    | 0.930    |
| MOH-X   | 0.814    | 0.803    |
| TroFi   | 0.633    | 0.605    |

## Quick Start

### Installation

```bash
pip install transformers torch
```

### Basic Usage

```python
from transformers import RobertaTokenizer
import torch

# Load model and tokenizer
model_path = "nixie1981/ConceptFrameMet"
tokenizer = RobertaTokenizer.from_pretrained(model_path)

# Example sentence
sentence = "The company is navigating through troubled waters"
target_word = "navigating"

# Predict metaphor with frame and source
result = predict_metaphor(sentence, target_word)

print(f"Is Metaphor: {result['is_metaphor']}")
print(f"Confidence: {result['metaphor_confidence']:.2f}")
print(f"Semantic Frame: {result['frame']}")
print(f"Source Domain: {result['source']}")
```

### Expected Output

```
Is Metaphor: True
Confidence: 0.92
Semantic Frame: Self_motion
Source Domain: JOURNEY
```

## Use Cases

1. **Metaphor Detection**: Identify metaphorical language in text
2. **Frame Analysis**: Understand conceptual frames in discourse
3. **Source Mapping**: Identify source-target domain mappings
4. **Literary Analysis**: Analyze figurative language patterns
5. **Education**: Teaching metaphor comprehension

## Model Inputs

The model expects:
- **sentence**: The full sentence containing the target word
- **target_word**: The specific word to analyze for metaphor

## Model Outputs

The model returns a dictionary with:
- `is_metaphor`: Boolean indicating if the target is metaphorical
- `metaphor_confidence`: Confidence score for metaphor prediction (0-1)
- `frame`: Predicted semantic frame
- `frame_confidence`: Confidence for frame prediction
- `source`: Predicted source domain (for metaphors)
- `source_confidence`: Confidence for source prediction

## Citation

If you use this model in your research, please cite:

```bibtex
@misc{conceptframemet2026,
  title={ConceptFrameMet: Metaphor Detection with Frame and Source Domain Prediction},
  author={Your Name},
  year={2026},
  url={https://huggingface.co/YOUR_USERNAME/ConceptFrameMet}
}
```



## Contact

For questions or issues, please open an issue on the model repository or contact [your email].