Question about testing CSV reader (With REST)

Hi There,

I am trying to implement faq with my own csv file. I’ve gotten this working with your example (the deeppavlov faq_school_en.csv file). But when I add an extra line with my own question and answer, which at first worked, now it just gives me an answer from the school.csv like so:
“A program taught in Russian will cost you 250,000 rubles per year. The fees on English-taught programs are higher, at 400,000 rubles per year.”
Even when I reference an empty csv file in the faq.json (located in configs/faq folder). It still gives me that answer, how is this possible? (Personally I was thinking there might be some other file that is created when using the faq model the first time which it references from then on)

So I am stuck want to progress with my own Q&A’s and get them working, any tips?

Hi, @kostis95,

Did you train the model on your new data?
Also, if you have download=True in your starting configuration, the model will be rewritten with a pre-trained one

Well I’m not entirely sure how to train it with REST.
But in python I get the same problem, my code is the following:

from deeppavlov import train_model, configs
faq = train_model(configs.faq.servoy_faq, download = False)
result = faq([“What colors are Giraffes?”])
print(result)

So I need download to be on False then always when using my own data?
The train_model trains the model right?

Well I’m not entirely sure how to train it with REST.

DeepPavlov has no interfaces to train models with REST as of yet

So I need download to be on False then always when using my own data?

You can remove the metadata.download section from your configuration or update it to download your models when setting download=True. Otherwise — yes.

The train_model trains the model right?

Yes. It trains the model and saves artifacts of training to the save_path paths in the configuration. If save_path is the same as load_path for every component, it should be loaded next time when using build_model

Oh yes it works with Python, thank you so much!

However if I run with REST afterwards it should recognize this new trained Q&A pair right? Because that doesn’t work for me.

  1. I run “python3 -m deeppavlov riseapi /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/deeppavlov/configs/faq/servoy_faq.json -d” in terminal.
  2. I open browser and enter http://0.0.0.0:5000
  3. I press Try it out and write my question like so:
    {
    “q”: [
    “What is the correct answer?”
    ]
    }
  4. The answer I get back is not correct (again the standard answer:
    “A program taught in Russian will cost you 250,000 rubles per year. The fees on English-taught programs are higher, at 400,000 rubles per year.”