示例#1
0
    def run(self):
        datasetFile = 'CSVdataset - Sheet1.csv'
        df = pd.read_csv(datasetFile)
        # Create a new Faker and tell it how to create User objects

        for index, dataset in df.iterrows():
            # print(dataset['paragraph'])
            dt = Dataset(dataset['paragraph'], dataset['intent'], 'nocontext')
            self.db.session.add(dt)
示例#2
0
def store():
    context = 'nocontext'
    intent = request.json['intent']
    paragraph = request.json['paragraph']

    if 'context' in request.json:
        context = request.json['context']

    dataset = Dataset(context=context, intent=intent, paragraph=paragraph)

    db.session.add(dataset)
    db.session.commit()

    data = singleTransform(dataset)

    return responses.created(data, 'Dataset successfully created')