GithubHelp home page GithubHelp logo

Error occurred when I ran docqa about claf HOT 5 CLOSED

directv00 avatar directv00 commented on August 20, 2024
Error occurred when I ran docqa

from claf.

Comments (5)

DongjunLee avatar DongjunLee commented on August 20, 2024

Oh, That's my mistake.

There will be no problem if you edit the code like below.

  • before
answer = claf_machine.get_answer(question) 
  • after
answer = claf_machine(question)

from claf.

directv00 avatar directv00 commented on August 20, 2024

After edit and run, I got an another error after calculating doc scores,

Completed!
Ready ..!
Question > 동학의 2대 교주 이름은?

Doc Scores:

  • 교주 : 0.5337303876876831
  • 교주도 : 0.4840213656425476
  • 동학 : 0.4764273464679718
  • 이름 : 0.3633122742176056
  • 작은 수의 이름 : 0.33019009232521057

Traceback (most recent call last):
File "machine.py", line 22, in
answer = claf_machine(question)
File "/workspace/claf/claf/machine/open_qa.py", line 100, in call
answer_text = self.machine_reading(passage, question)
File "/workspace/claf/claf/machine/open_qa.py", line 111, in machine_reading
return self.rc_experiment.predict(raw_feature)
File "/workspace/claf/claf/learn/experiment.py", line 428, in predict
interactive=arguments.get("interactive", False),
File "/workspace/claf/claf/learn/trainer.py", line 536, in predict
output_dict = self.model(tensor_feature)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(input, **kwargs)
File "/workspace/claf/claf/model/reading_comprehension/docqa.py", line 210, in forward
context_self_attnded = self.self_attention(context_encoded, context_mask) # B X C_L X dim
2
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/workspace/claf/claf/model/reading_comprehension/docqa.py", line 273, in forward
context_self_attnded = self.self_attention(context, context_mask, context, context_mask)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/workspace/claf/claf/modules/attention/docqa_attention.py", line 46, in forward
diag_mask = self.diag_mask.narrow(0, 0, seq_length).narrow(1, 0, seq_length)
RuntimeError: start (0) + length (5769) exceeds dimension size (2000).

from claf.

DongjunLee avatar DongjunLee commented on August 20, 2024

Each document has a different length of paragraph.
Some paragraphs will be very long.

DocQA's max_sequence_length is fixed 2000.
(claf.modules.attention.docqa_attention.py)

from claf.

directv00 avatar directv00 commented on August 20, 2024

Is it possible to change max_sequence_length to bigger one?
When I set 10000, it gave an error that seemed to be a size problem.

from claf.

DongjunLee avatar DongjunLee commented on August 20, 2024

It is possible, but you will have to re-trainining it to use.

from claf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.