Giter Club home page Giter Club logo

sinoparserd's Introduction

sinoparserd

A service to convert chinese languages (mandarin. cantonese. shanghainese..) into their transliterated form. to segment them etc.

The license only apply to the source code The data files are provided only as example

Requirement

  • libexpat
  • libevent

Install

If you never used cmake have a look at this tutorial.

git clone git://github.com/allan-simon/sinoparserd
sudo apt-get install libexpat1{,-dev} libevent-{2.0-5,dev} cmake
cd sinoparserd/ && cmake ./ && make

This should output something like:

compilation screenshot

Usage

./sinoparserd -c  doc/cantonese.xml -m doc/mandarin.xml -p PORT

That will launch an HTTP server listening on port PORT. If the option -p is missing it will listen on port 8080

it provides the following API call, that will return a XML answer

Updating Data Files

To regenerate doc/mandarin.xml with an updated version of CC-CEDICT, run

python tools/mandarin > doc/mandarin.xml

If any new ambiguous entries have been added to CC-CEDICT, this will fail. In that case, add the entries in question to tools/mandarin/preference.py to specify which variant should be used.

Evaluating Transcriptions

To evaluate changes to the transcription engine, tools/batch_transcribe.py and tools/diff can be used as follows:

  1. Get the list of Mandarin sentences from Tatoeba:
wget 'https://downloads.tatoeba.org/exports/per_language/cmn/cmn_sentences.tsv.bz2'
bunzip2 cmn_sentences.tsv.bz2
  1. Run sinoparserd with the old configuration
sinoparserd -m old_mandarin.xml
  1. Transcribe all sentences
cat cmn_sentences.tsv | tools/batch_transcribe.py > old_cmn_transcriptions.tsv
  1. Run sinoparserd with the new configuration and repeat.
  2. Generate a report of the differences
python tools/diff/ {old,new}_cmn_transcriptions.tsv > report.html
  1. View the generated HTML in a browser.
  2. To compare against manually edited transcriptions, download them from Tatoeba
wget 'https://downloads.tatoeba.org/exports/transcriptions.tar.bz2'
tar xf transcriptions.tar.bz2
  1. And include them in the comparison
python tools/diff/ {old,new}_cmn_transcriptions.tsv transcriptions.csv > report.html

License

All the source code is licensed under GPLv3, the xml files are under their own license.

The license for cantonese.xml (likely sourced from cantodict) is an "open one" but i need to check which one, certainly CC-BY-SA.

The license for mandarin.xml (sourced from CC-CEDICT) is CC BY-SA 4.0. See the comment at the beginning of the file for more details.

So for the moment I would recommend people to use their own data files for "public usage" and use the provided xml only for "test" purpose.

sinoparserd's People

Contributors

yorwba avatar allan-simon avatar jiru avatar da-liii avatar

Stargazers

Alejandro Zuleta avatar

Watchers

 avatar Trang avatar  avatar James Cloos avatar  avatar  avatar

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.