Comments (8)
it might be caused by the empty doc object
just edit the code around line 480 in coref.py:
add
self.train_corpus = [doc for doc in self.train_corpus if doc.sents]
before
# Randomly sample documents from the train corpus batch = random.sample(self.train_corpus, self.steps)
the same idea also works in the evaluation process
from coreference-resolution.
have you fixed this problem? I got the same issue.
from coreference-resolution.
I am facing the same issue. I think the problem is that some documents are not parsed correctly and their sents property is left as an empty list.
from coreference-resolution.
Same problem here. Just following.
from coreference-resolution.
I got that, too. I think it's because some embeddings are zeros. Can we directly skip those?
from coreference-resolution.
I am facing the similiar problem but in first evaluation. I had added
self.train_corpus = [doc for doc in self.train_corpus if doc.sents]
and finished 10 epoches training, then in first evaluate stage, the issue is as follows. Have you ever faced this issue and how did you resolve it?
EVALUATION
Evaluating on validation corpus...
31it [02:12, 1.26it/s]Traceback (most recent call last):
File "coref.py", line 696, in <module>
trainer.train(150)
File "coref.py", line 467, in train
results = self.evaluate(self.val_corpus)
File "coref.py", line 572, in evaluate
predicted_docs = [self.predict(doc) for doc in tqdm(val_corpus)]
File "coref.py", line 572, in <listcomp>
predicted_docs = [self.predict(doc) for doc in tqdm(val_corpus)]
File "coref.py", line 601, in predict
spans, probs = self.model(doc)
File "/home/LAB/lizr/.conda/envs/lzrconda3.6/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
result = self.forward(*input, **kwargs)
File "coref.py", line 423, in forward
states, embeds = self.encoder(doc)
File "/home/LAB/lizr/.conda/envs/lzrconda3.6/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
result = self.forward(*input, **kwargs)
File "coref.py", line 205, in forward
packed, reorder = pack(embeds)
File "/home/LAB/lizr/coreference-resolution/src/utils.py", line 73, in pack
packed = pack_sequence(sorted_tensors)
File "/home/LAB/lizr/.conda/envs/lzrconda3.6/lib/python3.6/site-packages/torch/nn/utils/rnn.py", line 353, in pack_sequence
return pack_padded_sequence(pad_sequence(sequences), [v.size(0) for v in sequences])
File "/home/LAB/lizr/.conda/envs/lzrconda3.6/lib/python3.6/site-packages/torch/nn/utils/rnn.py", line 311, in pad_sequence
max_size = sequences[0].size()
IndexError: list index out of range
from coreference-resolution.
I am facing the similiar problem but in first evaluation. I had added
self.train_corpus = [doc for doc in self.train_corpus if doc.sents]
and finished 10 epoches training, then in first evaluate stage, the issue is as follows. Have you ever faced this issue and how did you resolve it?EVALUATION Evaluating on validation corpus... 31it [02:12, 1.26it/s]Traceback (most recent call last): File "coref.py", line 696, in <module> trainer.train(150) File "coref.py", line 467, in train results = self.evaluate(self.val_corpus) File "coref.py", line 572, in evaluate predicted_docs = [self.predict(doc) for doc in tqdm(val_corpus)] File "coref.py", line 572, in <listcomp> predicted_docs = [self.predict(doc) for doc in tqdm(val_corpus)] File "coref.py", line 601, in predict spans, probs = self.model(doc) File "/home/LAB/lizr/.conda/envs/lzrconda3.6/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__ result = self.forward(*input, **kwargs) File "coref.py", line 423, in forward states, embeds = self.encoder(doc) File "/home/LAB/lizr/.conda/envs/lzrconda3.6/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__ result = self.forward(*input, **kwargs) File "coref.py", line 205, in forward packed, reorder = pack(embeds) File "/home/LAB/lizr/coreference-resolution/src/utils.py", line 73, in pack packed = pack_sequence(sorted_tensors) File "/home/LAB/lizr/.conda/envs/lzrconda3.6/lib/python3.6/site-packages/torch/nn/utils/rnn.py", line 353, in pack_sequence return pack_padded_sequence(pad_sequence(sequences), [v.size(0) for v in sequences]) File "/home/LAB/lizr/.conda/envs/lzrconda3.6/lib/python3.6/site-packages/torch/nn/utils/rnn.py", line 311, in pad_sequence max_size = sequences[0].size() IndexError: list index out of range
it might be caused by the empty doc object
just edit the code around line 480 in coref.py:
add
self.train_corpus = [doc for doc in self.train_corpus if doc.sents]
before
# Randomly sample documents from the train corpus batch = random.sample(self.train_corpus, self.steps)
the same idea also works in the evaluation process
Well, liking henryhust's method. I add the line in coref.py , line 467
self.val_corpus.docs = [doc for doc in self.val_corpus if doc.sents]
before results = self.evaluate(self.val_corpus)
. I finished train and evaluation but my result is poor as follows:
Epoch: 150 | Loss: 2832.548317 | Mention recall: 0.067340 | Coref recall: 0.024316 | Coref precision: 0.020000
.
Did you have a result like papers?And did you modify other line except #12 ?
from coreference-resolution.
I have the same problem. Have you solved it? Could you discuss it?
from coreference-resolution.
Related Issues (20)
- need data set HOT 1
- hello,author, I am
- hello,author ,i am try to train a model with your code,the data used conll2012,i found it precise loss decrease, precise approximately equal to 0. HOT 7
- Pretrained model?
- A bug, can you fix that? HOT 1
- train issue HOT 2
- Do you figure out your TODO list?
- Error during training HOT 4
- probs = [F.softmax(tensr) for tensr in with_epsilon] may be wrong?
- model does not predict clusters HOT 3
- What should I do with the data? HOT 4
- Is there a problem in function:"remove_overlapping(sorted_spans):" ? HOT 5
- Gamma in the LR scheduler is too small
- Error in sentence truncation
- RuntimeError: received an empty list of sequences HOT 1
- How to preprocess the Data ? HOT 2
- RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation HOT 2
- the performance of model ? HOT 1
- error when evaluating HOT 2
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 coreference-resolution.