GithubHelp home page GithubHelp logo

canclid / canto-filter Goto Github PK

View Code? Open in Web Editor NEW
30.0 8.0 2.0 27 KB

粵文語料篩選器 Cantonese text filter

Home Page: https://pypi.org/project/canto-filter/

License: MIT License

Python 100.00%
cantonese cantonese-language corpus corpus-data data nlp

canto-filter's People

Contributors

alienkevin avatar chaaklau avatar graphemecluster avatar laubonghaudoi 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

canto-filter's Issues

Thoughts on automating the addition of canto_unique characters and phrases

Because we don't have a reliable Cantonese tokenizer, all the phrases added to the classifier need to satisfy the following property, in addition to not being shared by Mandarin:
Frequency of the phrase is very low in an untokenized Mandarin corpus. We don't want incorrect word boudaries to mess up our classification. For example, if the phrases like 全家下棋 are common in Mandarin, we don't want to add the phrase 家下 to canto_unique. The classifier will incorrectly estimate the word boundary in Mandarin texts and judge a Mandarin text to be Cantonese.

A way to automate the additions

Words.hk provides lists of Cantonese phrases and characters as well as their common variants. It also has labels on whether the phrase is a 書面語. We first exclude any 書面語 words from our candidates for canto_unique. Then, we can search each of the remaining characters or phrases in a large Mandarin corpus (e.g. Wudao Corpus 2.0 publushed a 200GB corpus for the public). If the character/phrase appears under a certain frequency, we add it to the canto_unique list. Alternatively, we can generate such a list of candidates and manually review them before adding them to the list.

Shortcomings of the current classification model

Since we don't have a Cantonese tokenizer, we have to rely on a coarser statistical estimation. It might result in some false positives (classified as Cantonese but is actually Mandarin) and some false negatives (the Cantonese word is disguised under 假借 or it's simply not on our list). Under these constraints, the best approach is to increase the number of canto_unique words that are very rare in Mandarin. Another approach is to add more mando_unique words that appear very rarely in Cantonese. This would require us to lookup the words in a large Cantonese corpus (e.g. LIHKG forum). However, since the written Cantonese corpuses I'm aware of are generally much smaller than their Mandarin counterparts and represent a certain age-range, I think the former approach relying on Mandarin corpuses would yield a more reliable classification.

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.