October 2018
Intermediate to advanced
472 pages
10h 57m
English
After creating the data structure in tabular format, as mentioned previously, we will be calculating the predicted answer to a question every time a user queries our bot. We load all of the question-answer pairs from the dataset.
Let's load our CSV file using pandas, and perform some pre-processing on the dataset:
import pandas as pdfilepath = 'sample_data.csv'csv_reader=pd.read_csv(filepath)question_list = csv_reader[csv_reader.columns[0]].values.tolist()answers_list = csv_reader[csv_reader.columns[1]].values.tolist()query= 'Can I get an Americano, btw how much it will cost ?'
Read now
Unlock full access