Comments (5)
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.
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 dim2
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.
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.
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.
It is possible, but you will have to re-trainining it to use.
from claf.
Related Issues (20)
- The segmentation fault error occurred in prediction mode and Korean question & context. HOT 3
- Error occured in data reading by Bert_basic tokenizer HOT 7
- error! HOT 5
- how to get the many answers in PREDICT Mode?
- How to get the many answers in predict mode? HOT 4
- Set up a CD/CI pipeline & Documentation
- Add Tasks (Dialog, NLU, Semantic Parsing, Knowledge Graph and more...)
- conflict btw save & load HOT 1
- 'trainer.py' update 건의 HOT 1
- predict 이슈 HOT 5
- fasttext.wiki.ko.300d.txt 파일 생성 방법 HOT 4
- flatten_parameters() HOT 2
- script/install_mecab.sh에서 명령어를 바꿔야 될 것 같습니다 HOT 3
- training이 오류가 납니다 HOT 12
- Pre-trained model은 없나요 HOT 3
- train.py가 gpu모드를 쓸 수 없습니다 HOT 2
- 하이퍼파라미터에 대한 질문입니다 HOT 1
- (JSON) base_config 설정이 안됩니다.
- TypeError: FeatLabelPadCollator.collate: `pad_value` is not present.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from claf.