cdQA icon indicating copy to clipboard operation
cdQA copied to clipboard

How to use cdQA for non-English language?

Open suhamera opened this issue 4 years ago • 2 comments

I tried to use the library to train set in Russian and it did not work out much.

What I've done for it:

Here is my code to do this:

import torch from cdqa.reader import BertQA from transformers import BertForQuestionAnswering, DistilBertForQuestionAnswering import joblib import os reader = BertQA()

reader.model = BertForQuestionAnswering.from_pretrained("bert-base-multilingual-uncased")

reader.model.to('cpu') reader.device = torch.device('cpu')

joblib.dump(reader, os.path.join("models", 'ml_qa_bert.joblib'))

After I trained the model and tried to make query, I have this error: AttributeError: Can only use .str accessor with string values!

What am I doing wrong and what should I do to make cdQA work with Russian?

suhamera avatar Apr 15 '20 21:04 suhamera

I don't think this issue is related to the title of your question. That might be why you're not getting help.

jdagdelen avatar Jul 19 '20 19:07 jdagdelen

Me too i want to use Spanish for this, However your error is related to the formatting of data, check the demo, for more clarity on how the data is ('paragraphs' and 'title'...)

sadakmed avatar Sep 02 '20 15:09 sadakmed