Text Classification
Transformers
Safetensors
English
roberta
scientific-text
abstract-sections
text-embeddings-inference
Instructions to use hongccccccc/roberta-abstract-section-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hongccccccc/roberta-abstract-section-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="hongccccccc/roberta-abstract-section-classifier")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("hongccccccc/roberta-abstract-section-classifier") model = AutoModelForSequenceClassification.from_pretrained("hongccccccc/roberta-abstract-section-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files- README.md +76 -0
- config.json +44 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +17 -0
- training_args.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: roberta-base
|
| 5 |
+
pipeline_tag: text-classification
|
| 6 |
+
library_name: transformers
|
| 7 |
+
tags:
|
| 8 |
+
- scientific-text
|
| 9 |
+
- abstract-sections
|
| 10 |
+
- citation-analysis
|
| 11 |
+
- sequential-sentence-classification
|
| 12 |
+
widget:
|
| 13 |
+
- text: "We conclude that early intervention significantly improves patient outcomes."
|
| 14 |
+
example_title: "Conclusion sentence"
|
| 15 |
+
- text: "Participants were randomly assigned to treatment and control groups."
|
| 16 |
+
example_title: "Methods sentence"
|
| 17 |
+
- text: "The aim of this study was to evaluate the efficacy of the new vaccine."
|
| 18 |
+
example_title: "Objective sentence"
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# RoBERTa Abstract-Section Classifier
|
| 22 |
+
|
| 23 |
+
A `roberta-base` model fine-tuned to classify sentences from scientific abstracts into **five rhetorical sections**: `BACKGROUND`, `CONCLUSIONS`, `METHODS`, `OBJECTIVE`, `RESULTS` (the PubMed-RCT-style section scheme).
|
| 24 |
+
|
| 25 |
+
It was built for a large-scale **citation-fidelity** study, where it selected each cited paper's *claim* sentences — sentences predicted as `CONCLUSIONS` or `RESULTS` (and longer than 50 characters) — from ~13M S2ORC abstracts. Those claims were then compared against citing sentences with the [SPICED](https://huggingface.co/copenlu/spiced) scientific-sentence similarity model to measure how faithfully papers describe the work they cite.
|
| 26 |
+
|
| 27 |
+
## Labels
|
| 28 |
+
|
| 29 |
+
| id | label | typical sentence |
|
| 30 |
+
|----|-------------|--------------------------------------------------|
|
| 31 |
+
| 0 | BACKGROUND | "Diabetes is a growing public health concern…" |
|
| 32 |
+
| 1 | CONCLUSIONS | "We conclude that early intervention improves outcomes." |
|
| 33 |
+
| 2 | METHODS | "Participants were randomly assigned to two groups…" |
|
| 34 |
+
| 3 | OBJECTIVE | "The aim of this study was to evaluate…" |
|
| 35 |
+
| 4 | RESULTS | "The treatment group showed a 40% reduction (p < 0.001)." |
|
| 36 |
+
|
| 37 |
+
## How to use
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
from transformers import pipeline
|
| 41 |
+
|
| 42 |
+
clf = pipeline("text-classification", model="hongccccccc/roberta-abstract-section-classifier")
|
| 43 |
+
clf("The treatment group showed a 40% reduction in mortality compared with placebo.")
|
| 44 |
+
# [{'label': 'RESULTS', 'score': 0.99}]
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
In the original pipeline, inference used `truncation=True, max_length=50`; sentences are short, so this rarely truncates.
|
| 48 |
+
|
| 49 |
+
## Training
|
| 50 |
+
|
| 51 |
+
- **Base model:** [`roberta-base`](https://huggingface.co/roberta-base), fine-tuned with `RobertaForSequenceClassification` (single-label, 5 classes).
|
| 52 |
+
- **Task/data:** abstract-sentence section classification following the PubMed-RCT label scheme.
|
| 53 |
+
- **Trained:** January 2023, `transformers` 4.12.5. The original `training_args.bin` is included in this repo for provenance; the training script itself was not preserved, so exact hyperparameters and the precise training split are unknown.
|
| 54 |
+
|
| 55 |
+
## Evaluation
|
| 56 |
+
|
| 57 |
+
No held-out evaluation from the original training survives. As a release sanity check, the model correctly classified a small battery of unambiguous section sentences (see the examples above) with high confidence. Treat downstream metrics as unverified and evaluate on your own data before critical use.
|
| 58 |
+
|
| 59 |
+
## Limitations
|
| 60 |
+
|
| 61 |
+
- Trained on **abstract** sentences from scientific (largely biomedical-style) papers; full-text sentences or other domains may degrade accuracy.
|
| 62 |
+
- Single-sentence input; it does not use surrounding-sentence context, which sequential models exploit for this task.
|
| 63 |
+
- Label ids in `config.json` were reconstructed from the inference code (`sci_parser.py`) of the original project and verified on sample sentences.
|
| 64 |
+
|
| 65 |
+
## Citation
|
| 66 |
+
|
| 67 |
+
If you use this model, please cite the citation-fidelity paper (to appear — citation forthcoming). Related resources:
|
| 68 |
+
|
| 69 |
+
```bibtex
|
| 70 |
+
@inproceedings{wright2022modeling,
|
| 71 |
+
title={Modeling Information Change in Science Communication with Semantically Matched Paraphrases},
|
| 72 |
+
author={Wright, Dustin and Pei, Jiaxin and Jurgens, David and Augenstein, Isabelle},
|
| 73 |
+
booktitle={EMNLP},
|
| 74 |
+
year={2022}
|
| 75 |
+
}
|
| 76 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_cross_attention": false,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"RobertaForSequenceClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"eos_token_id": 2,
|
| 11 |
+
"hidden_act": "gelu",
|
| 12 |
+
"hidden_dropout_prob": 0.1,
|
| 13 |
+
"hidden_size": 768,
|
| 14 |
+
"id2label": {
|
| 15 |
+
"0": "BACKGROUND",
|
| 16 |
+
"1": "CONCLUSIONS",
|
| 17 |
+
"2": "METHODS",
|
| 18 |
+
"3": "OBJECTIVE",
|
| 19 |
+
"4": "RESULTS"
|
| 20 |
+
},
|
| 21 |
+
"initializer_range": 0.02,
|
| 22 |
+
"intermediate_size": 3072,
|
| 23 |
+
"is_decoder": false,
|
| 24 |
+
"label2id": {
|
| 25 |
+
"BACKGROUND": 0,
|
| 26 |
+
"CONCLUSIONS": 1,
|
| 27 |
+
"METHODS": 2,
|
| 28 |
+
"OBJECTIVE": 3,
|
| 29 |
+
"RESULTS": 4
|
| 30 |
+
},
|
| 31 |
+
"layer_norm_eps": 1e-05,
|
| 32 |
+
"max_position_embeddings": 514,
|
| 33 |
+
"model_type": "roberta",
|
| 34 |
+
"num_attention_heads": 12,
|
| 35 |
+
"num_hidden_layers": 12,
|
| 36 |
+
"pad_token_id": 1,
|
| 37 |
+
"position_embedding_type": "absolute",
|
| 38 |
+
"problem_type": "single_label_classification",
|
| 39 |
+
"tie_word_embeddings": true,
|
| 40 |
+
"transformers_version": "5.11.0",
|
| 41 |
+
"type_vocab_size": 1,
|
| 42 |
+
"use_cache": true,
|
| 43 |
+
"vocab_size": 50265
|
| 44 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1fc7207aada50f687c5ea1d087489c01c1ce9e69df1dccbf3c6511d4c0909246
|
| 3 |
+
size 498622052
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<s>",
|
| 5 |
+
"cls_token": "<s>",
|
| 6 |
+
"eos_token": "</s>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"is_local": false,
|
| 9 |
+
"local_files_only": false,
|
| 10 |
+
"mask_token": "<mask>",
|
| 11 |
+
"model_max_length": 512,
|
| 12 |
+
"pad_token": "<pad>",
|
| 13 |
+
"sep_token": "</s>",
|
| 14 |
+
"tokenizer_class": "RobertaTokenizer",
|
| 15 |
+
"trim_offsets": true,
|
| 16 |
+
"unk_token": "<unk>"
|
| 17 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5e223b6115aa22b61c8a1d9ab03437de7b16d25c427b38c35ad75b32d7a9f54b
|
| 3 |
+
size 2799
|