Given this notebook from huggingface
  

      github.com
  

  
    huggingface/notebooks/blob/master/examples/question_answering.ipynb 1


    {
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "X4cRE8IbIrIV"
   },
   "source": [
    "If you're opening this Notebook on colab, you will probably need to install 🤗 Transformers and 🤗 Datasets. Uncomment the following cell and run it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 1000
    },
    "id": "MOsHUjgdIrIW",



  This file has been truncated. show original

  

  
    
    
  

  


If I want to use other dataset , like this one, Streamlit 1
the dataset has list kind of field for ‘context’,
please check is my change correct to make it a string (I am getting error without this)

for i, example in enumerate(datasets[“train”]):
if len(tokenizer(example[“question”], str(example[“context”][“contexts”]))[“input_ids”]) > 384:
break
example = datasets[“train”][i]

initially, it was

for i, example in enumerate(datasets[“train”]):
if len(tokenizer(example[“question”], example[“context”])[“input_ids”]) > 384:
break
example = datasets[“train”][i]