How to use database?

I would like to know, how to use reformer with database that you mentioned in the lab, like data/restaurant_db.json, data/hospital_db.json etc… Do I understand correct, that you omit this thing in your lab — how to use big additional context of conversation like database, to get usefull answers?

@someone555777 I am sorry… I am having some difficulty interpreting what exactly it is you are asking here:

  1. What do you mean by ‘reformer database’ ?

  2. Are you asking how to load/parse a JSON file ? To start, this basic code should work:

import json

# Opening my_data JSON file
file = open('my_data.json')

# returns JSON file as a dictionary
my_data = json.load(file)

Then probe accordingly.

In the NLP course, specifically they tend to use ‘pickle’ methods because they are serializing already existing Python objects/data types. Great for convenience, terrible for security.

As to the whole question/answer bit… Well this is a very, very big topic. It is covered a little in the DLS specialization, and in much more depth in the NLP one.

However, since you pose this sort of question (I have not taken it)-- I would highly suggest you check out the GenAI for everyone course. I think that should give you at least a rough idea of where to go with that ?

I said not reformer database, I asked about usage of reformer with usage of database as input :slight_smile:

I completed DLS and NLP specializations, the same as GenAI and I didn’t have enough clear answer on them. Just one of your course gave me more-less working solution — LangChain Chat with Your Data and another LangChain courses. Specially I found usefull RetrievalQA class.

But it is something about LLM from the box with usage via api, for example. But what about reformer when I train and use it from scratch? Do I understand right that a moment of passing of a database to a reformer to get usefull actual answers is fully omited in the last lab?