poltextlab's picture
Update gated prompt
e53cd79 verified
metadata
license: cc-by-4.0
language:
  - multilingual
tags:
  - zero-shot-classification
  - text-classification
  - pytorch
metrics:
  - accuracy
  - f1-score
extra_gated_prompt: >-
  Our models are intended for academic projects and academic research only. If
  you are not affiliated with an academic institution, please reach out to us at
  huggingface [at] poltextlab [dot] com for further inquiry. If we cannot
  clearly determine your academic affiliation and use case based on your form
  data, your request may be rejected. Please allow us a few business days to
  manually review subscriptions.
extra_gated_fields:
  Country: country
  Institution: text
  Institution Email: text
  Full Name: text
  Please specify your academic project/use case you want to use the models for: text

xlm-roberta-large-pooled-cap-minor-v3

Model description

An xlm-roberta-large model finetuned on multilingual (english, danish, hungarian) training data labelled with minor topic codes from the Comparative Agendas Project.

How to use the model

from transformers import AutoTokenizer, pipeline

tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-large")
pipe = pipeline(
    model="poltextlab/xlm-roberta-large-pooled-cap-minor-v3",
    task="text-classification",
    tokenizer=tokenizer,
    use_fast=False,
    truncation=True,
    max_length=512,
    token="<your_hf_read_only_token>"
)

text = "We will place an immediate 6-month halt on the finance driven closure of beds and wards, and set up an independent audit of needs and facilities."
pipe(text)

Gated access

Due to the gated access, you must pass the token parameter when loading the model. In earlier versions of the Transformers package, you may need to use the use_auth_token parameter instead.

Model performance

The model was evaluated on a test set of 165443 english and hungarian examples.

  • Accuracy: 0.87.
  • Weighted Average F1-score: 0.86

Inference platform

This model is used by the CAP Babel Machine, an open-source and free natural language processing tool, designed to simplify and speed up projects for comparative research.

Cooperation

Model performance can be significantly improved by extending our training sets. We appreciate every submission of CAP-coded corpora (of any domain and language) at poltextlab{at}poltextlab{dot}com or by using the CAP Babel Machine.

Debugging and issues

This architecture uses the sentencepiece tokenizer. In order to run the model before transformers==4.27 you need to install it manually.

If you encounter a RuntimeError when loading the model using the from_pretrained() method, adding ignore_mismatched_sizes=True should solve the issue.