Update README.md
Browse files9 unmodified lines101112131415165 unmodified lines222324252627281 unmodified line30313233343536373839404142434445464748495051525354555657585960616263649 unmodified lines# UPC-HLE Cross-Encoder ModelsWelcome to the UPC-HLE organization on HuggingFace!This repository hosts the cross-encoder models developed for our submission to **SemEval-2025 Task 7: Multilingual and Cross-lingual Fact-Checked Claim Retrieval**. Our approach combines dense Text Embedding Models (TEMs) with a neural Cross-Encoder re-ranking stage to retrieve fact-checked claims for social-media posts in a multilingual setting :contentReference[oaicite:0]{index=0}​:contentReference[oaicite:1]{index=1}.---5 unmodified linesEncode the query (post) and all fact-check documents with a bi-encoder TEM to get dense embeddings. Retrieve the top 100 candidates by cosine similarity.2. **Cross-Encoder Re-Ranking**Fine-tune a transformer-based Cross-Encoder (Jina Reranker v2) on triplets of (post, candidate, label) using hard-negative sampling. Re-score the 100 candidates to produce the final ranked list :contentReference[oaicite:2]{index=2}​:contentReference[oaicite:3]{index=3}.This yields strong improvements over lexical baselines and standalone embeddings, especially in cross-lingual retrieval.1 unmodified line## 📦 Models in This OrganizationWe provide four fine-tuned Cross-Encoder models, each differing by the base TEM and any additional filtering:| Model Name | Base TEM | Dataset | Notes ||--------------------------|-----------------------------------|-------------------|---------------------------------------------------------------|| **mTEM-CE-Eng-SF** | Arctic-Embed-L-v2.0 (Snowflake) | English only | Our primary system; top performer on monolingual retrieval. || **mTEM-CE-E5** | Multilingual-E5-large | Multilingual | Cross-lingual variant using E5 embeddings. || **mTEM-CE-Eng-E5** | Multilingual-E5-large | English only | English dataset with E5 embeddings. || **mTEM-LF-CE-Eng-E5** | Multilingual-E5-large + Lexical Filter | English only | Applies a lexical overlap filter before CE re-ranking. :contentReference[oaicite:4]{index=4}​:contentReference[oaicite:5]{index=5} |---## 🚀 UsageInstall the 🤗 Transformers library and then load any model as follows:```pythonfrom transformers import AutoTokenizer, AutoModelForSequenceClassificationmodel_id = "UPC-HLE/mTEM-CE-Eng-SF" # or any other model nametokenizer = AutoTokenizer.from_pretrained(model_id)model = AutoModelForSequenceClassification.from_pretrained(model_id)# Example inference for a single query–candidate pairquery = "Did the AMA approve hydroxychloroquine for COVID-19?"candidate = "The American Medical Association does not reject nor support hydroxychloroquine as a treatment for COVID-19."inputs = tokenizer(query, candidate, return_tensors="pt", truncation=True, padding=True)logits = model(**inputs).logitsscore = logits.softmax(dim=1)[0, 1].item() # relevance scoreprint(f"Relevance score: {score:.4f}")```---9 unmodified lines101112131415165 unmodified lines222324252627281 unmodified line3031323334353637383940414243444546474849505152535455565758596061629 unmodified lines# UPC-HLE Cross-Encoder ModelsWelcome to the UPC-HLE organization on HuggingFace!This repository hosts the cross-encoder models developed for our submission to [SemEval-2025 Task 7: Multilingual and Cross-lingual Fact-Checked Claim Retrieval](https://disai.eu/semeval-2025/). Our approach combines dense Text Embedding Models (TEMs) with a neural Cross-Encoder re-ranking stage to retrieve fact-checked claims for social-media posts in a multilingual setting. The dataset is a subset of [MultiClaim Dataset](https://zenodo.org/records/7737983).---5 unmodified linesEncode the query (post) and all fact-check documents with a bi-encoder TEM to get dense embeddings. Retrieve the top 100 candidates by cosine similarity.2. **Cross-Encoder Re-Ranking**Fine-tune a transformer-based Cross-Encoder (Jina Reranker v2) on triplets of (post, candidate, label) using hard-negative sampling. Re-score the 100 candidates to produce the final ranked list.This yields strong improvements over lexical baselines and standalone embeddings, especially in cross-lingual retrieval.1 unmodified line## 📦 Models in This OrganizationThese are the best performing models in the final solution for the shared task. The bi-encoder retrieval is performed using [Snowflake/snowflake-arctic-embed-l-v2.0](https://huggingface.co/Snowflake/snowflake-arctic-embed-l-v2.0)and, afterwards, the re-ranking is done using the models available in this repository, which use Jina V2 as base Cross Encoder.**Languages Available**- **English** (eng)- **French** (fra)- **German** (deu)- **Portuguese** (por)- **Thai** (tha)- **Malay** (msa)- **Arabic** (ara)- **Polish** (pol)- **Turkish** (tur)- **Crosslingual**Thanks to its XLM-RoBERTa backbone, the model can encode sentences in any of these languages into the same 768-dimensional vector space. You can therefore use the **same** model instance to compute embeddings and cosine-similarity scores for queries and fact-check candidates **across** all test‐set languages, without loading separate language-specific checkpoints.## 🚀 UsageInstall the 🤗 Sentence Transformers library and then load any model as follows:```pythonfrom sentence_transformers import CrossEncoderrerank_model = CrossEncoder(reranker_model_name, num_labels=1, max_length=1024, trust_remote_code=True)ranked_vals = rerank_model.rank(str_candidate, ls_factchecks, show_progress_bar=False)```---
README.md+22-24