# 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].