Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Comments

Support returning generator from Tagger#35

Merged
uezo merged 3 commits intomasterfrom
develop
Sep 3, 2020
Merged

Support returning generator from Tagger#35
uezo merged 3 commits intomasterfrom
develop

Conversation

@uezo
Copy link
Owner

@uezo uezo commented Sep 3, 2020

Add parse_as_generator method to MeCabTagger, JanomeTagger and Tagger(base) to save CPU and memory resources.
For now, tagger.parse() is called automatically in core.chat() so this new method is unused.

TODO: Enable to switch parsing morph automatically or manually. The way for app code to access tagger should be well considered.

uezo added 3 commits September 3, 2020 21:58
Add `parse_as_generator` method to MeCabTagger, JanomeTagger and Tagger(base) to save CPU and memory resources.
For now, `tagger.parse()` is called automatically in `core.chat()` so this new method is unused.
TODO: Enable to switch parsing morph automatically or manually
Enable to switch off parsing morph by passing `parse_morph=False` when create Minette object.
Also add `tagger` to DialogService and DialogRouter. To parse manually call `self.tagger.parse(request.text)` or `self.tagger.parse_as_generator(request.text)`.
@uezo uezo merged commit 83c8d2b into master Sep 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant