ubc-nlp / turjuman Goto Github PK
View Code? Open in Web Editor NEWTURJUMAN, a neural toolkit for translating from 20 languages into Modern Standard Arabic (MSA).
Home Page: https://demos.dlnlp.ai/turjuman
License: Apache License 2.0
TURJUMAN, a neural toolkit for translating from 20 languages into Modern Standard Arabic (MSA).
Home Page: https://demos.dlnlp.ai/turjuman
License: Apache License 2.0
Hey, would you like to add the benchmark to Masader?
Hey there, I hope you're doing fine.
when running the command: turj.translate
it returns the token ids instead of the actual translation?
(see the output below)
2022-07-07 10:41:43 | INFO | turjuman.translate | Using beam search
tensor([[ 0, 6538, 2, 76, 6380, 1]])
When running the following command, the error presented below is raised:
Beam search is the default generation method on Turjuman
!turjuman_translate --text "As US reaches one million COVID deaths, how are Americans coping?"
IndexError: too many indices for tensor of dimension 2
/usr/local/bin/turjuman_translate:8 in <module> │
│ │
│ 5 from turjuman_cli.translate import translate_cli │
│ 6 if __name__ == '__main__': │
│ 7 │ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) │
│ ❱ 8 │ sys.exit(translate_cli()) │
│ 9 │
│ │
│ /usr/local/lib/python3.9/dist-packages/turjuman_cli/translate.py:76 in │
│ translate_cli │
│ │
│ 73 │ │
│ 74 │ torj = turjuman(logger, args.cache_dir) │
│ 75 │ if input_source=="text": │
│ ❱ 76 │ │ torj.translate_from_text (args.text, args.search_method, args.s │
│ 77 │ elif input_source=="file": │
│ 78 │ │ torj.translate_from_file (args.input_file, args.search_method, │
│ 79 │
│ │
│ /usr/local/lib/python3.9/dist-packages/turjuman/turjuman.py:93 in │
│ translate_from_text │
│ │
│ 90 │ │ outputs = self.translate(sources, search_method, seq_length, m │
│ 91 │ │ │
│ 92 │ │ if max_outputs==1: │
│ ❱ 93 │ │ │ targets = outputs['target'][0] │
│ 94 │ │ else: │
│ 95 │ │ │ targets = outputs[str(max_outputs)+'_targets'][0] │
│ 96 │ │ if type(targets) == list:
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.