Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mykytea with no word segmentation #14

Open
himkt opened this issue Jul 3, 2018 · 1 comment
Open

Mykytea with no word segmentation #14

himkt opened this issue Jul 3, 2018 · 1 comment

Comments

@himkt
Copy link
Collaborator

himkt commented Jul 3, 2018

I want to use Mykytea with no word segmentation mode (-nows).
But it seems not to be possible in current implementation.

Example of -nows shows below.

echo '私 は 猫 で す'| kytea -nows

私/代名詞/わたくし は/助詞/は 猫/名詞/ねこ で/助動詞/で す/語尾/す

My code to try to use -nows shows below.

import Mykytea


if __name__ == '__main__':
    kytea_tagger = Mykytea.Mykytea('-nows')
    print(kytea_tagger.getTagsToString('私 は 猫 で す'))

And I execute this program to get the result...

python main.py

私/代名詞/わたくし  /補助記号/UNK は/助詞/は  /補助記号/UNK 猫/名詞/ねこ  /補助記号/UNK で/助動詞/で  /補助記号/UNK す/語尾/す

Problem

There are unnecessary UNK symbols in the analysis result.
This is same as analyzing space splitted sentence with -nows.

echo '私 は 猫 で す'| kytea`

私/代名詞/わたくし \ /補助記号/UNK は/助詞/は \ /補助記号/UNK 猫/名詞/ねこ \ /補助記号/UNK で/助動詞/で \ /補助記号/UNK す/語尾/す

So I think Mykytea() could not take the -nows option correctly.
Regards,

@chezou
Copy link
Owner

chezou commented Jul 3, 2018

Current implementation of getTags* doesn't care -nows option appropriately. MyKytea should consider the configuration via config->getDoWS() whether it is required to call calculateWS(). ref:
https://github.com/neubig/kytea/blob/e5d4b765a6140508d56bf2a06676c0c4b1abfc50/src/test/test-analysis.h#L220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants