Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use cdQA for non-English language? #362

Open
suhamera opened this issue Apr 15, 2020 · 2 comments
Open

How to use cdQA for non-English language? #362

suhamera opened this issue Apr 15, 2020 · 2 comments

Comments

@suhamera
Copy link

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?

@jdagdelen
Copy link

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

@sadakmed
Copy link

sadakmed commented Sep 2, 2020

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'...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants