/ Модель

Характеристики

Контекст
512 токенов
Параметры
129 млн
Архитектура
bert · dense
Опубликована
2 мар 2022

roberta-base-finetuned-jd-full-chinese

Классификация текстаТекст → label4 профессии

Производная модели uer/roberta-base-finetuned-chinanews-chinese. Китайская RoBERTa-Base, дообученная для тематической классификации новостных текстов.

134скачиваний за 30 дней14лайковвеса обновлены17 окт 2023

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Карточка модели uer/roberta-base-finetuned-jd-full-chinese на Hugging Face совпадает с карточкой uer/roberta-base-finetuned-chinanews-chinese, поэтому описание составлено по ней.

Это китайская модель RoBERTa-Base для классификации текста, дообученная командой UER с помощью UER-py на наборе Chinanews. В карточке показан пример классификации китайской новостной фразы с меткой «политика материкового Китая». Репозиторий содержит около 129,5 млн параметров; модель использует архитектуру BertForSequenceClassification и принимает последовательности длиной до 512 токенов.

Модель предназначена для определения тематических классов китайских новостных текстов. Её можно загружать через Transformers и использовать для автоматической тематической разметки новостных фрагментов. Обучающие наборы также включали китайские отзывы с метками тональности, однако этот конкретный чекпойнт обучен на Chinanews.

В карточке не приведены метрики качества и перечень всех меток классов. Поддерживаются форматы PyTorch, TensorFlow и Flax. Лицензия в предоставленных данных не указана.

Сценарии применения

  • Определение темы китайских новостных фрагментов
  • Автоматическая категоризация китайских новостей
  • Разметка новостных материалов по политическим и другим темам

Ограничения

В карточке не приведены метрики качества и полный перечень классов. Контекст ограничен 512 токенами.

Для каких профессий подходит4

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Chinese RoBERTa-Base Models for Text Classification

Model description

This is the set of 5 Chinese RoBERTa-Base classification models fine-tuned by UER-py, which is introduced in this paper. Besides, the models could also be fine-tuned by TencentPretrain introduced in this paper, which inherits UER-py to support models with parameters above one billion, and extends it to a multimodal pre-training framework.

You can download the 5 Chinese RoBERTa-Base classification models either from the UER-py Modelzoo page, or via HuggingFace from the links below:

DatasetLink
JD fullroberta-base-finetuned-jd-full-chinese
JD binaryroberta-base-finetuned-jd-binary-chinese
Dianpingroberta-base-finetuned-dianping-chinese
Ifengroberta-base-finetuned-ifeng-chinese
Chinanewsroberta-base-finetuned-chinanews-chinese

How to use

You can use this model directly with a pipeline for text classification (take the case of roberta-base-finetuned-chinanews-chinese):

>>> from transformers import AutoModelForSequenceClassification,AutoTokenizer,pipeline
>>> model = AutoModelForSequenceClassification.from_pretrained('uer/roberta-base-finetuned-chinanews-chinese')
>>> tokenizer = AutoTokenizer.from_pretrained('uer/roberta-base-finetuned-chinanews-chinese')
>>> text_classification = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
>>> text_classification("北京上个月召开了两会")
    [{'label': 'mainland China politics', 'score': 0.7211663722991943}]

Training data

5 Chinese text classification datasets are used. JD full, JD binary, and Dianping datasets consist of user reviews of different sentiment polarities. Ifeng and Chinanews consist of first paragraphs of news articles of different topic classes. They are collected by Glyph project and more details are discussed in the corresponding paper.

Training procedure

Models are fine-tuned by UER-py on Tencent Cloud. We fine-tune three epochs with a sequence length of 512 on the basis of the pre-trained model chinese_roberta_L-12_H-768. At the end of each epoch, the model is saved when the best performance on development set is achieved. We use the same hyper-parameters on different models.

Taking the case of roberta-base-finetuned-chinanews-chinese

python3 finetune/run_classifier.py --pretrained_model_path models/cluecorpussmall_roberta_base_seq512_model.bin-250000 \
                                   --vocab_path models/google_zh_vocab.txt \
                                   --train_path datasets/glyph/chinanews/train.tsv \
                                   --dev_path datasets/glyph/chinanews/dev.tsv \
                                   --output_model_path models/chinanews_classifier_model.bin \
                                   --learning_rate 3e-5 --epochs_num 3 --batch_size 32 --seq_length 512

Finally, we convert the pre-trained model into Huggingface's format:

python3 scripts/convert_bert_text_classification_from_uer_to_huggingface.py --input_model_path models/chinanews_classifier_model.bin \
                                                                            --output_model_path pytorch_model.bin \
                                                                            --layers_num 12

BibTeX entry and citation info

@article{liu2019roberta,
  title={Roberta: A robustly optimized bert pretraining approach},
  author={Liu, Yinhan and Ott, Myle and Goyal, Naman and Du, Jingfei and Joshi, Mandar and Chen, Danqi and Levy, Omer and Lewis, Mike and Zettlemoyer, Luke and Stoyanov, Veselin},
  journal={arXiv preprint arXiv:1907.11692},
  year={2019}
}

@article{zhang2017encoding,
  title={Which encoding is the best for text classification in chinese, english, japanese and korean?},
  author={Zhang, Xiang and LeCun, Yann},
  journal={arXiv preprint arXiv:1708.02657},
  year={2017}
}

@article{zhao2019uer,
  title={UER: An Open-Source Toolkit for Pre-training Models},
  author={Zhao, Zhe and Chen, Hui and Zhang, Jinbin and Zhao, Xin and Liu, Tao and Lu, Wei and Chen, Xi and Deng, Haotang and Ju, Qi and Du, Xiaoyong},
  journal={EMNLP-IJCNLP 2019},
  pages={241},
  year={2019}
}

@article{zhao2023tencentpretrain,
  title={TencentPretrain: A Scalable and Flexible Toolkit for Pre-training Models of Different Modalities},
  author={Zhao, Zhe and Li, Yudong and Hou, Cheng and Zhao, Jing and others},
  journal={ACL 2023},
  pages={217},
  year={2023}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · text-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
BertForSequenceClassification
Ревизия весов
4f338f2

0 моделей