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

NER: Add html-like tag in output #262

Merged
merged 5 commits into from
Sep 1, 2019
Merged

NER: Add html-like tag in output #262

merged 5 commits into from
Sep 1, 2019

Conversation

wannaphong
Copy link
Member

Add output like html tag (ThaiNameTagger).

>>> from pythainlp.tag.named_entity import ThaiNameTagger
>>> ner = ThaiNameTagger()
>>> ner.get_ner("วันที่ 15 ก.ย. 61 ทดสอบระบบเวลา 14:49 น.",tag=True)
'วันที่ <DATE>15 ก.ย. 61</DATE> ทดสอบระบบเวลา <TIME>14:49 น.</TIME>'

@pep8speaks
Copy link

pep8speaks commented Aug 31, 2019

Hello @wannaphongcom! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 144:80: E501 line too long (80 > 79 characters)

Comment last updated at 2019-08-31 10:21:42 UTC

@coveralls
Copy link

coveralls commented Aug 31, 2019

Coverage Status

Coverage increased (+0.05%) to 93.646% when pulling 937aecb on ner-tag into db39f8e on dev.


return [(self.__pos_tags[i][0], data) for i, data in enumerate(self.__y)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good if we have tests for this change.

Chakri Lowphansirikul added 2 commits August 31, 2019 16:30
changes in this commit:

- assert the output of the method `get_ner`
   when argument `tag` is set to True
   for all 13 tags as described in
   (https://github.com/wannaphongcom/thai-ner/tree/master/model/1.2)

- assert the output of the method `get_ner`
   when argument `pos` is set to True

- asser the output of the method `get_ner`
   when argument `pos` is set to False

self.assertEqual(
ner.get_ner(
"อาจารย์เอกพล ประจำคณะวิสกรรมศาสตร์ ",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes. Thanks for checking the typos.

@p16i
Copy link
Contributor

p16i commented Aug 31, 2019

Apart from the typo, the PR looks good to me.

Chakri Lowphansirikul added 2 commits August 31, 2019 16:48
As thainer version 1.2 provide different results from previous version
@wannaphong wannaphong added this to the 2.1 milestone Aug 31, 2019
@wannaphong
Copy link
Member Author

if this pull request is ready, you can merge it.

@lalital lalital merged commit c90b686 into dev Sep 1, 2019
@bact bact changed the title NER : Add output like html tag NER: Add html-like tag in output Oct 5, 2019
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

Successfully merging this pull request may close these issues.

None yet

5 participants