Utility functions: rearrange package locations + add thai_strftime() date and time formatter#160
Utility functions: rearrange package locations + add thai_strftime() date and time formatter#160bact merged 16 commits intoPyThaiNLP:devfrom bact:dev
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.
ผมสงสัยทำไมผลลัพธ์ test ตรง ner ออกมาแปลก ๆ ก่อนหน้านี้ครับ
There was a problem hiding this comment.
ไม่แน่ใจเลยครับ โค้ดเหมือนเดิมทุกอย่างนะครับ
There was a problem hiding this comment.
ตอนนี้ได้แบบนี้ครับ
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.
แต่จริงๆ โดยไอเดีย unit test ตรงนี้ควรจะเป็นการทดสอบว่า ทำงานได้ตาม logic ของโปรแกรม ในแง่ flow
ส่วน accuracy ของผลลัพธ์อาจจะต้อง test กันอีกแบบ โดยเฉพาะกับงานที่ใช้ความน่าจะเป็นมาเกี่ยวข้องในการหาผลลัพธ์ครับ (การอัปเดตโมเดล อาจทำให้ผลลัพธ์เปลี่ยนได้)
thai_strftimein pythainlp.util