Comments (11)
Could show the flags you used to initialize opus_reader
?
from opustools.
My your_script.py:
import opustools_pkg
opus_reader = opustools_pkg.OpusRead(["-d", "JW300", "-s", "en", "-t", "ta", "-wm" "tmx"])
opus_reader.printPairs()
from opustools.
My your_script.py:
import opustools_pkg opus_reader = opustools_pkg.OpusRead(["-d", "JW300", "-s", "en", "-t", "ta", "-wm" "tmx"]) opus_reader.printPairs()
You are missing a comma between "-wm"
and "tmx"
, but I don't think that's causing the error here. I suspect this is an issue with Windows encoding behavior. I'll try to setup a Windows environment and see if I can replicate the error. In the meanwhile, you could try to run your script in a unix-like environment, if you have access to one.
from opustools.
from opustools.
from opustools.
@gertva I haven't been able to set up a Windows environment, but I changed something in the program: I now specify the encoding of the result files, which might help with your issue. Upgrade opustools_pkg
to version 0.0.43
, run your script again and let me know if it works.
I'll probably get my hands on a Windows machine by tomorrow, so I'll be able to do proper debugging.
from opustools.
from opustools.
Great, good to hear!
from opustools.
from opustools.
Almost, you have to include --
before the language id flags. You can also use split()
to make the argument list formation a little easier like this:
opus_reader = opustools_pkg.OpusRead("-d JW300 -f -ln -s en -t ta -wm tmx -w enta.tmx --src_cld2 en 0.95 --trg_cld2 ta 0.95 --src_langid en 0.95 --trg_langid ta 0.95".split())
But for this to work, you have to create the language ids to the zip files, as they don't yet include them by default. First you need to install pycld2
and langid
:
pip install pycld2
pip install langid
Then you can run a script like this to create the language ids:
from opustools_pkg.opus_langid import OpusLangid
OpusLangid("-f JW300_latest_xml_en.zip -v".split()).processFiles()
OpusLangid("-f JW300_latest_xml_ta.zip -v".split()).processFiles()
And then you can filter by language ids.
from opustools.
from opustools.
Related Issues (20)
- Alignment problem with JW300 corpora? HOT 1
- PyPI wheel includes old files HOT 2
- Where are the missing language pairs? HOT 1
- Memory Issue: opus_read fails to extract MultiCCAligned HOT 1
- Missing alignment data for English(en) - Oromo(om)? HOT 1
- What is the tokenizer for all languages?
- Format of downloaded files does not match the format expected by opus_read HOT 1
- malformed tmx from opus_read HOT 1
- Using opus_read with -az, -sz, -tz options HOT 1
- Add progress indicator to opus_express HOT 2
- Misleading logging information in opus_express HOT 1
- Is it possible to download all corpus associate with the given language pair? HOT 1
- opus_get downloads *all* corpora with just the -s switch HOT 1
- opus_read fails to extract CCMatrix HOT 3
- DB for off-line search HOT 1
- support search with 3-letter language codes or BCP-47
- Recreate sample files shown in OpenSubtitles corpus HOT 1
- Spaces before punctation marks on opus_read output HOT 1
- change in OPUS yaml files HOT 1
- Cannot download resource due to `DH_KEY_TOO_SMALL`
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 opustools.