Git Product home page Git Product logo

biaffineparser's People

Contributors

chantera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

biaffineparser's Issues

Input preprocessing

Can you tell more about the format in which input has to be given? It has not been mentioned in the Readme and I am having an issue using this repo.

parser.py --test : ValueError: could not broadcast input array from shape (63) into shape (64)

Hi , When I run the test , the following error occurs:
file: <class 'str'>
model_file: <class 'chainer_model.DeepBiaffine'>
2019-01-29 11:03:57.087 CST bfc81b [trace] Orthogonal pretrainer loss: 4.45e-29
2019-01-29 11:03:58.607 CST bfc81b [trace] Orthogonal pretrainer loss: 4.24e-29
2019-01-29 11:03:58.623 CST bfc81b [error] Exception occurred during execution:
Traceback (most recent call last):
File "/home/lxiao/workspace/BiaffineParser/src/teras/teras/app/init.py", line 58, in run
self._process()
File "/home/lxiao/workspace/BiaffineParser/src/teras/teras/app/init.py", line 102, in _process
self._command(**kwargs)
File "parser.py", line 221, in test
_load_test_model(model, model_file, device_id=gpu)
File "parser.py", line 180, in _load_test_model
chainer.serializers.load_npz(file, model)
File "/home/lxiao/anaconda3/lib/python3.6/site-packages/chainer/serializers/npz.py", line 140, in load_npz
d.load(obj)
File "/home/lxiao/anaconda3/lib/python3.6/site-packages/chainer/serializer.py", line 83, in load
obj.serialize(self)
File "/home/lxiao/anaconda3/lib/python3.6/site-packages/chainer/link.py", line 795, in serialize
d[name].serialize(serializer[name])
File "/home/lxiao/anaconda3/lib/python3.6/site-packages/chainer/link.py", line 551, in serialize
data = serializer(name, param.data)
File "/home/lxiao/anaconda3/lib/python3.6/site-packages/chainer/serializers/npz.py", line 113, in call
numpy.copyto(value, dataset)
ValueError: could not broadcast input array from shape (63) into shape (64)
2019-01-29 11:03:58.624 CST bfc81b [info] LOG End with ACCESSID=[bfc81b] UNIQUEID=[UNIQID] ACCESSTIME=[2019 -01-29 11:03:16.919340 CST] PROCESSTIME=[41.704970000]

PS: my test data as follows:

1	只有	只有	_	_	_	7	obj	_	_
2	是	是	_	_	_	2	obj	_	_
3	签署	签署	_	_	_	7	obj	_	_
4	协定	协定	_	_	_	3	obj	_	_
5	两国	两国	_	_	_	4	obj	_	_
6	的	的	_	_	_	3	obj	_	_
7	居民	居民	_	_	_	10	obj	_	_
8	才	才	_	_	_	10	obj	_	_
9	会	会	_	_	_	10	obj	_	_
10	使用	使用	_	_	_	0	root	_	_
11	该	该	_	_	_	12	obj	_	_
12	协定	协定	_	_	_	14	obj	_	_
13	的	的	_	_	_	12	obj	_	_
14	条款	条款	_	_	_	10	obj	_	_
15	。	。	_	_	_	10	obj	_	_

ValueError: operands could not be broadcast together with shapes (37,100) (37,300)

2019-02-18 20:48:24.230 CST e2989e [info] saving the context to model/20190218-e2989e.context ...
0%| | 0/3997 [00:00<?, ?it/s]2019-02-18 20:48:24.748 CST e2989e [error] Exception occurred during execution:
Traceback (most recent call last):
File "/home/liuxiao/workspace/dependency-parser/biaffineparser/src/teras/teras/app/app.py", line 60, in run
self._process()
File "/home/liuxiao/workspace/dependency-parser/biaffineparser/src/teras/teras/app/app.py", line 104, in _process
self._command(**kwargs)
File "src/main.py", line 73, in train
trainer.fit(train_dataset, test_dataset, n_epoch, batch_size)
File "/home/liuxiao/workspace/dependency-parser/biaffineparser/src/teras/teras/training/trainer.py", line 107, in fit
main_loop()
File "/home/liuxiao/workspace/dependency-parser/biaffineparser/src/teras/teras/training/trainer.py", line 98, in main_loop
self._process(forward, train_dataset, lossfun, convert, batch_size, epoch_logs)
File "/home/liuxiao/workspace/dependency-parser/biaffineparser/src/teras/teras/training/trainer.py", line 145, in _process
ys = forward(*xs)
File "/home/liuxiao/miniconda3/lib/python3.6/site-packages/chainer/link.py", line 242, in call
out = forward(*args, **kwargs)
File "/home/liuxiao/workspace/dependency-parser/biaffineparser/src/models.py", line 122, in forward
self._hs = self.encoder(words, pretrained_words, postags)
File "/home/liuxiao/miniconda3/lib/python3.6/site-packages/chainer/link.py", line 242, in call
out = forward(*args, **kwargs)
File "/home/liuxiao/workspace/dependency-parser/biaffineparser/src/models.py", line 264, in forward
rs = self._concat_embeds(self.embeds(*xs))
File "/home/liuxiao/workspace/dependency-parser/biaffineparser/src/models.py", line 274, in _concat_embeds
rs_words = [rs_word_seq + rs_pre_seq for rs_word_seq, rs_pre_seq in zip(rs_words, rs_words_pretrained)]
File "/home/liuxiao/workspace/dependency-parser/biaffineparser/src/models.py", line 274, in
rs_words = [rs_word_seq + rs_pre_seq for rs_word_seq, rs_pre_seq in zip(rs_words, rs_words_pretrained)]
File "/home/liuxiao/miniconda3/lib/python3.6/site-packages/chainer/functions/math/basic_math.py", line 229, in add
return Add().apply((lhs, rhs))[0]
File "/home/liuxiao/miniconda3/lib/python3.6/site-packages/chainer/function_node.py", line 263, in apply
outputs = self.forward(in_data)
File "/home/liuxiao/miniconda3/lib/python3.6/site-packages/chainer/functions/math/basic_math.py", line 156, in forward
y = utils.force_array(x[0] + x[1])
ValueError: operands could not be broadcast together with shapes (37,100) (37,300)
When using a pre-trained word vector file with a dimension of 300, the following error is exposed. Also modified to word_embed_size=300 in dataset.py
Would you share the word vector file you used in your code? Thank you so much!

解析速度

作者你好,
请问,你设计的解析器每秒大概能解析多少个句子。

Pytorch model

I met a problem when I ran this model implemented by pytorch. You said the pytorch model weight initialization and GPU computation have not been completed yet. Will you update this code later?

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.