/ Модель

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

Контекст
512 токенов
Лицензия
MIT
Архитектура
distilbert · dense
Опубликована
16 янв 2024

pebblo-classifier

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

Дообученная DistilBERT-модель DAXA.AI классифицирует англоязычные документы соглашений по 21 категории.

699скачиваний за 30 дней9лайковвеса обновлены30 мая 2024

Бенчмарки

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

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

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

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

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

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

Pebblo Classifier — модель DAXA.AI для классификации англоязычных документов соглашений по 21 категории. Она предназначена для автоматической сортировки договорных документов в организациях и может применяться в системах управления документами и RAG-контурах.

Модель построена на DistilBERT и дообучена на базе distilbert-base-uncased. По карточке, обучающая выборка содержит 141 055 примеров; контекст модели — до 512 токенов. На тестовой выборке указаны accuracy 0,8424 и F1 0,8505. Лицензия — MIT.

Качество зависит от соответствия входных документов обучающим категориям и распределению данных. В карточке также отмечена возможность смещений; для других типов документов или языков показатели не приведены.

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

  • автоматическая сортировка соглашений по типам
  • классификация документов для корпоративного архива
  • определение категории договора перед маршрутизацией на проверку
  • разметка соглашений в потоке обработки документов
  • классификация договорных документов в RAG-системе

Ограничения

Модель рассчитана на категории соглашений из обучающего набора; качество на других типах документов и языках не указано. В карточке отмечен риск смещений, а максимальная длина контекста составляет 512 токенов.

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

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

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

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

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

Открыть на Hugging Face

Model Card for Model ID

This model card outlines the Pebblo Classifier, a machine learning system specialized in text classification. Developed by DAXA.AI, this model is adept at categorizing various agreement documents within organizational structures, trained on 21 distinct labels.

Model Details

Model Description

The Pebblo Classifier is a BERT-based model, fine-tuned from distilbert-base-uncased, targeting RAG (Retrieve-And-Generate) applications. It classifies text into categories such as "BOARD_MEETING_AGREEMENT," "CONSULTING_AGREEMENT," and others, streamlining document classification processes.

  • Developed by: DAXA.AI
  • Funded by: Open Source
  • Model type: Classification model
  • Language(s) (NLP): English
  • License: MIT
  • Finetuned from model: distilbert-base-uncased

Model Sources

Uses

Intended Use

The model is designed for direct application in document classification, capable of immediate deployment without additional fine-tuning.

Recommendations

End-users should be cognizant of potential biases and limitations inherent in the model. For optimal use, understanding these aspects is recommended.

How to Get Started with the Model

Use the code below to get started with the model.

# Import necessary libraries
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
import joblib
from huggingface_hub import hf_hub_url, cached_download

# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("daxa-ai/pebblo-classifier")
model = AutoModelForSequenceClassification.from_pretrained("daxa-ai/pebblo-classifier")

# Example text
text = "Please enter your text here."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)

# Apply softmax to the logits
probabilities = torch.nn.functional.softmax(output.logits, dim=-1)

# Get the predicted label
predicted_label = torch.argmax(probabilities, dim=-1)

# URL of your Hugging Face model repository
REPO_NAME = "daxa-ai/pebblo-classifier"

# Path to the label encoder file in the repository
LABEL_ENCODER_FILE = "label_encoder.joblib"

# Construct the URL to the label encoder file
url = hf_hub_url(REPO_NAME, filename=LABEL_ENCODER_FILE)

# Download and cache the label encoder file
filename = cached_download(url)

# Load the label encoder
label_encoder = joblib.load(filename)

# Decode the predicted label
decoded_label = label_encoder.inverse_transform(predicted_label.numpy())

print(decoded_label)

Training Details

Training Data

The training dataset consists of 141,055 entries, with 21 unique labels. The labels span various document types, with instances distributed across three text sizes (128 ± x, 256 ± x, and 512 ± x words; x varies within 20). Here are the labels along with their respective counts in the dataset:

Agreement TypeInstances
BOARD_MEETING_AGREEMENT4,206
CONSULTING_AGREEMENT2,965
CUSTOMER_LIST_AGREEMENT8,966
DISTRIBUTION_PARTNER_AGREEMENT5,144
EMPLOYEE_AGREEMENT3,876
ENTERPRISE_AGREEMENT4,213
ENTERPRISE_LICENSE_AGREEMENT8,999
EXECUTIVE_SEVERANCE_AGREEMENT8,996
FINANCIAL_REPORT_AGREEMENT11,384
HARMFUL_ADVICE1,887
INTERNAL_PRODUCT_ROADMAP_AGREEMENT6,982
LOAN_AND_SECURITY_AGREEMENT8,957
MEDICAL_ADVICE3,847
MERGER_AGREEMENT7,704
NDA_AGREEMENT5,221
NORMAL_TEXT8,994
PATENT_APPLICATION_FILLINGS_AGREEMENT8,802
PRICE_LIST_AGREEMENT8,906
SETTLEMENT_AGREEMENT3,737
SEXUAL_CONTENT8,957
SEXUAL_INCIDENT_REPORT8,321

Evaluation

Testing Data & Metrics

Testing Data

Evaluation was performed on a dataset of 86,281 entries with a temperature range of 1-1.25 for randomness. Here are the labels along with their respective counts in the dataset:

Agreement TypeInstances
BOARD_MEETING_AGREEMENT3,975
CONSULTING_AGREEMENT1,430
CUSTOMER_LIST_AGREEMENT4,488
DISTRIBUTION_PARTNER_AGREEMENT6,696
EMPLOYEE_AGREEMENT1,310
ENTERPRISE_AGREEMENT1,501
ENTERPRISE_LICENSE_AGREEMENT7,967
EXECUTIVE_SEVERANCE_AGREEMENT4,795
FINANCIAL_REPORT_AGREEMENT4,686
HARMFUL_ADVICE361
INTERNAL_PRODUCT_ROADMAP_AGREEMENT3,740
LOAN_AND_SECURITY_AGREEMENT5,833
MEDICAL_ADVICE643
MERGER_AGREEMENT6,557
NDA_AGREEMENT1,352
NORMAL_TEXT5,811
PATENT_APPLICATION_FILLINGS_AGREEMENT5,608
PRICE_LIST_AGREEMENT5,044
SETTLEMENT_AGREEMENT5,377
SEXUAL_CONTENT4,356
SEXUAL_INCIDENT_REPORT4,750

Metrics

Agreement Typeprecisionrecallf1-scoresupport
BOARD_MEETING_AGREEMENT0.920.950.933,975
CONSULTING_AGREEMENT0.810.850.831,430
CUSTOMER_LIST_AGREEMENT0.900.880.894,488
DISTRIBUTION_PARTNER_AGREEMENT0.730.630.686,696
EMPLOYEE_AGREEMENT0.850.840.851,310
ENTERPRISE_AGREEMENT0.180.700.291,501
ENTERPRISE_LICENSE_AGREEMENT0.920.780.847,967
EXECUTIVE_SEVERANCE_AGREEMENT0.970.880.924,795
FINANCIAL_REPORT_AGREEMENT0.930.990.964,686
HARMFUL_ADVICE0.920.940.93361
INTERNAL_PRODUCT_ROADMAP_AGREEMENT0.940.980.963,740
LOAN_AND_SECURITY_AGREEMENT0.930.970.955,833
MEDICAL_ADVICE0.931.000.96643
MERGER_AGREEMENT0.930.450.616,557
NDA_AGREEMENT0.680.910.781,352
NORMAL_TEXT0.950.940.955,811
PATENT_APPLICATION_FILLINGS_AGREEMENT0.960.990.985,608
PRICE_LIST_AGREEMENT0.760.790.775,044
SETTLEMENT_AGREEMENT0.760.780.775,377
SEXUAL_CONTENT0.920.970.944,356
SEXUAL_INCIDENT_REPORT0.990.940.964,750
accuracy0.8486,280
macro avg0.850.860.8486,280
weighted avg0.880.840.8586,280

Results

The model’s performance is summarized by precision, recall, and f1-score metrics, which are detailed across all 21 labels in the dataset. Based on the test data evaluation results, the model achieved an accuracy of 0.8424, a precision of 0.8794, and a recall of 0.8424. The F1-score, which is the harmonic mean of precision and recall, stands at 0.8505.

The evaluation loss, which measures the discrepancy between the model’s predictions and the actual values, is 0.6815. Lower loss values indicate better model performance.

The model was able to process approximately 97.684 samples per second during the evaluation, which took a total runtime of 883.2545 seconds. The model performed approximately 0.764 evaluation steps per second.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
DistilBertForSequenceClassification
Ревизия весов
402f3c6

0 моделей