antonisa / inflection Goto Github PK
View Code? Open in Web Editor NEWMorphological Inflection for Low-Resource Languages using cross-lingual transfer
Home Page: https://arxiv.org/pdf/1908.05838.pdf
Morphological Inflection for Low-Resource Languages using cross-lingual transfer
Home Page: https://arxiv.org/pdf/1908.05838.pdf
Hi !
I ran into a problem when running the script on UniMorph data of a particular language. It is running on the sample data given in the folder, but when I try to do it on some other data it is giving the following error :
$ python inflection.py --datapath sample-data/ --L1 bengali --L2 hindi --mode train --setting original
And the output produced is :
[dynet] allocating memory: 512MB
[dynet] memory allocation done.
Traceback (most recent call last):
File "/inflection/inflection.py", line 229, in <module>
low_i, low_o, low_t = myutil.read_data(LOW_PATH)
File "/inflection/myutil.py", line 34, in read_data
outputs.append(list(l[1]))
IndexError: list index out of range
If it helps, I used hindi data from the unimorph repo, and splitted in the ratio 80:10:10 for train, test and dev.
A few more commands are needed to configure the system (Ubuntu 20):
sudo pip3 install cython
When I tried to run the following script
py inflection.py \
--datapath sample-data/ \
--L1 adyghe \
--L2 kabardian \
--mode train \
--setting original
I have got the error:
Traceback (most recent call last):
File "inflection.py", line 1500, in <module>
trainer, best_acc, best_edd = train_simple_attention_with_tags(inflection_model, MULTIPLY*low_i+high_i, MULTIPLY*low_t+high_t, MULTIPLY*low_o+high_o)
File "inflection.py", line 1247, in train_simple_attention_with_tags
loss = inf_model.get_loss(inputs[j], [NULL], inputs[j], lang_ids[j])
File "inflection.py", line 897, in get_loss
return self.decode(encoded, encoded_tags, output_sentence, lang_id, weight, tf_prob)
File "inflection.py", line 489, in decode
w1dt = w1dt or self.attention_w1 * input_mat
File "_dynet.pyx", line 1907, in _dynet.Expression.__mul__
NotImplementedError
There is the following solution:
sudo pip3 install git+https://github.com/clab/dynet#egg=dynet
sudo pip3 install -r requirements.txt
P.S. Thank you for sharing this code!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.