Instructions to use USCchildinterviewinglab/roberta-question-type-classifier-2.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use USCchildinterviewinglab/roberta-question-type-classifier-2.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="USCchildinterviewinglab/roberta-question-type-classifier-2.0")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("USCchildinterviewinglab/roberta-question-type-classifier-2.0") model = AutoModelForSequenceClassification.from_pretrained("USCchildinterviewinglab/roberta-question-type-classifier-2.0", device_map="auto") - Notebooks
- Google Colab
- Kaggle
RoBERTa Question-Type Classifier 2.0
This repository contains a fine-tuned RoBERTa model for classifying interviewer utterances into six question-type categories.
Version 2.0 predicts six categories:
| Code | Question type |
|---|---|
| 0 | Non-question |
| 1 | Option-posing question (yes-no and forced-choice) |
| 2 | Wh-question (directive) |
| 3 | Invitation |
| 4 | Tag question |
| 5 | Do you know/remember question |
Access
This model uses gated access. Before downloading the model files, sign in to Hugging Face and accept the access conditions for this repository.
Access requests are automatically approved.
Getting the Model
After receiving access, you need to download the model files and notebook to your computer.
Option 1: Download from Hugging Face
Open the Files and versions tab and use the download button beside each file to download the repository files.
Keep the downloaded files together in one folder.
The folder should contain:
roberta_question_type_predictions_public.ipynbconfig.jsonmodel.safetensorsvocab.jsonmerges.txtspecial_tokens_map.jsontokenizer_config.json
Then open the folder in VS Code or another Jupyter-compatible environment and open:
roberta_question_type_predictions_public.ipynb
Option 2: Download with the Hugging Face CLI
If you have the Hugging Face CLI installed and are signed in, you can download the complete repository with:
hf download USCchildinterviewinglab/roberta-question-type-classifier-2.0 --local-dir roberta-question-type-classifier-2.0
Option 3: Clone with Git
If you are familiar with Git, you can instead clone the repository:
git clone https://huggingface.co/USCchildinterviewinglab/roberta-question-type-classifier-2.0
Cloning is optional. You do not need to use Git in order to run the classifier.
Requirements
- Python 3
- A Jupyter-compatible environment, such as VS Code with the Python and Jupyter extensions
- A Hugging Face account with access to this model in order to download the repository
The notebook installs the required Python packages for you.
Input Format
Your input must be a CSV file containing a column named exactly:
Question
Other columns are allowed and will be preserved in the output.
Example:
| Question |
|---|
| Tell me everything that happened. |
| Did you see him? |
| Where did you go? |
Running the Notebook
Download or clone this repository.
Open the repository folder in VS Code or another Jupyter-compatible environment.
Open
roberta_question_type_predictions_public.ipynb.If prompted to select a kernel:
- Click Select Kernel.
- Choose Python Environments....
- Select a Python 3 environment.
If you are using VS Code, make sure the Python and Jupyter extensions are installed.
Place a copy of your CSV file in the same repository folder as the notebook.
Make sure the CSV contains a column named exactly
Question.If your file is not named
input.csv, changeinput_filein Section 2 of the notebook to match your filename.Run the notebook cells from top to bottom.
The notebook does not overwrite the original file.
By default, predictions are written to:
input_with_question_type_predictions.csv
Two columns are added:
question_type_code: numeric prediction from 0–5question_type_label: corresponding question-type label
Optional: Load the Model Directly with Transformers
Developers can also load the model directly from Hugging Face using the Transformers library instead of using the included notebook.
Because this model uses gated access, the Python environment must be authenticated with a Hugging Face account that has access to the repository.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_id = "USCchildinterviewinglab/roberta-question-type-classifier-2.0"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
This option is intended for users who want to integrate the classifier into their own Python code or workflow.
Citation
Citation information will be added upon publication.
- Downloads last month
- -
Model tree for USCchildinterviewinglab/roberta-question-type-classifier-2.0
Base model
FacebookAI/roberta-base