-
Notifications
You must be signed in to change notification settings - Fork 277
Utility functions: rearrange package locations + add thai_strftime() date and time formatter #160
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
Conversation
merge README
- Add thai_strftime in pythainlp.util - Move small utility functions to pythainlp.util - Move ner to pythainlp.tag
Python strftime() depends on system's libc. GNU and BSD systems may different. |
ner = ThaiNameTagger() | ||
self.assertEqual(ner.get_ner(""), []) | ||
self.assertIsNotNone(ner.get_ner("แมวทำอะไรตอนห้าโมงเช้า")) | ||
# self.assertEqual( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ผมสงสัยทำไมผลลัพธ์ test ตรง ner ออกมาแปลก ๆ ก่อนหน้านี้ครับ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ไม่แน่ใจเลยครับ โค้ดเหมือนเดิมทุกอย่างนะครับ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ตอนนี้ได้แบบนี้ครับ
ner.get_ner("แมวทำอะไรตอนห้าโมงเช้า")
[('แมว', 'PROPN', 'O'), ('ทำ', 'VERB', 'O'), ('อะไร', 'PRON', 'O'), ('ตอน', 'NOUN', 'O'), ('ห้า', 'NOUN', 'B-TIME'), ('โมง', 'PROPN', 'I-TIME'), ('เช้า', 'NOUN', 'I-TIME')]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
แต่จริงๆ โดยไอเดีย unit test ตรงนี้ควรจะเป็นการทดสอบว่า ทำงานได้ตาม logic ของโปรแกรม ในแง่ flow
ส่วน accuracy ของผลลัพธ์อาจจะต้อง test กันอีกแบบ โดยเฉพาะกับงานที่ใช้ความน่าจะเป็นมาเกี่ยวข้องในการหาผลลัพธ์ครับ (การอัปเดตโมเดล อาจทำให้ผลลัพธ์เปลี่ยนได้)
thai_strftime
in pythainlp.util