theatticusproject/cuad-qa
Updated • 2.59k • 67
How to use muhtasham/bert-small-finetuned-cuad with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("question-answering", model="muhtasham/bert-small-finetuned-cuad") # Load model directly
from transformers import AutoTokenizer, AutoModelForQuestionAnswering
tokenizer = AutoTokenizer.from_pretrained("muhtasham/bert-small-finetuned-cuad")
model = AutoModelForQuestionAnswering.from_pretrained("muhtasham/bert-small-finetuned-cuad", device_map="auto")This model is a fine-tuned version of google/bert_uncased_L-4_H-512_A-8 on the portion of cuad dataset.
The model was not trained on the whole dataset but, the first 10% of train + the first 10% of test.
raw_datasets_train, raw_datasets_test = load_dataset("cuad", split=['train[:10%]', 'test[:10%]'])
datasets = DatasetDict({'train': raw_datasets_train, 'validation': raw_datasets_test})