Giter Site home page Giter Site logo

m4t1ss / softalignments Goto Github PK

View Code? Open in Web Editor NEW
72.0 6.0 14.0 23.68 MB

Neural macine translation soft alignment visualisations for web and command line

Home Page: http://attention.lielakeda.lv/

License: MIT License

Python 33.45% JavaScript 35.77% PHP 23.70% CSS 2.54% Shell 4.54%
mt machine-translation nmt neural-machine-translation nematus alignment neural-monkey attention-mechanism attention-alignment-visualization python

softalignments's People

Contributors

m4t1ss avatar obo 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

softalignments's Issues

Can not using compare with follow Readme.

runing scripts

input=a.nematus 
input2=b.nematus
output_type=web


python process_alignments.py \
    -i $input \
    -o $output_type \
    -f Nematus \
    -v Nematus \
    -w $input2 \

error log

process_alignments.py -i <input_file> [-o <output_type>] [-f <from_system>] [-s <source_sentence_file>] [-t <target_sentence_file>]
input_file is the file with alignment weights (required)
source_sentence_file and target_sentence_file are required only for NeuralMonkey
output_type can be web (default), block, block2 or color
from_system can be Nematus, Marian, Sockeye, OpenNMT or NeuralMonkey (default)

Option to combine subword units and their attentions

Probably add this to process_alignments.py as an optional parameter. If set, only save full words and combined attention weights in web output files or show a combined attention matrix in the command line output

Add some filters

For instance, only show sentences that are between in some range of character length.

Single attention-matrix format for easy integration

If tool accepts one single attention matrix format (should be specified in the docs), it will be easy to integrate the tool with different NMT frameworks.

NMT framework contributors will only have to save attention weights in the right format to use your tool.

Maximum execution time exceeded

Hi Matiss

For a very large alignments file (150 MB) I get the following error:

Fatal error: Maximum execution time of 30 seconds exceeded in /Users/mathiasmuller/Desktop/alignments/SoftAlignments/web/functions.php on line 54

Is there anything I can do? It would be nice if the tool could load bigger files on demand, e.g. for the web version.

Thanks and regards!
Mathias

Fails if source string empty

processAlignments currently fails if the source is empty and the only attention weights are 1.0s on the </s> (=<EOS>) token.

$ cat test.a
0 ||| a test ||| 8.20928 ||| ||| 0 2
1.0
1.0
1.0
$ python ~/SoftAlignments/process_alignments.py -i test.a -f Nematus -o color
Traceback (most recent call last):
  File "/home/user/mmueller/SoftAlignments/process_alignments.py", line 270, in <module>
    main(sys.argv[1:])
  File "/home/user/mmueller/SoftAlignments/process_alignments.py", line 252, in main
    functions.processAlignments(data, folder, inputfile, outputType, num, refs)
  File "/home/user/mmueller/SoftAlignments/functions.py", line 227, in processAlignments
    ali = [l[:len(list(filter(None, tgt)))] for l in rawAli[:len(src)]]
IndexError: invalid index to scalar variable.

Is this a bug / unaccounted-for edge case, or am I doing something wrong?

Having an empty source seems like a strange requirement, but I am working with multiple sources, so that's a real use case.

Thanks!

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.