Under The Sea Documentation

Similar documents
Under The Sea Documentation

Back UPS - UPS Line InterActive

ĐỌC, GHI XML VỚI C# TRONG ADO.NET --- SỬ DỤNG VISUAL STUDIO

Lab01: M V C Lưu ý: Để thực hành, các bạn phải cài Visual Studio 2013 trở lên mới hỗ trợ MVC5.

Mô hình dữ liệu quan hệ (Relational data model)

BẢO MẬT TRONG SQL SERVER

NHẬP MÔN LẬP TRÌNH KHOA HỌC DỮ LIỆU. Bài 10: Thư viện Pandas (2)

TÀI LIU H NG DN CÀI T, S DNG NG DNG TH IN T VI TÊN MIN WRU.VN

HƯỚNG DẪN CÀI ĐẶT PHẦN MỀM DIỆT VIRUS AVIRA

Khối: Cao Đẳng nghề và Trung Cấp Năm 2009

Internet Protocol. Bởi: Phạm Nguyễn Bảo Nguyên

BÁO GIÁ MODULE, PLC S7200

Online Appointment System will work better with below conditions/ Hệ thống đặt hẹn online sẽ hoạt động tốt hơn với điều kiện sau đây:

BELGIUM ONLINE APPOINTMENT

LIST OF AUTHORIZED RETAILERS. No Merchant name Address MID Location

BÀI 1: VBA LÀ GÌ? TẠO MACRO, ỨNG DỤNG CÁC HÀM TỰ TẠO (UDF), CÀI ĐẶT ADD-INS VBA là gì?

Chương 5. Network Layer 19/09/2016 1

Tài liệu hướng dẫn: Stored Procedure

Bộ môn MMT&TT, Khoa Công Nghệ Thông Tin và TT, ĐH Cần Thơ

HTML DOM - Forms. MSc. nguyenhominhduc

HỢP ĐỒNG MUA BÁN HÀNG HÓA QUỐC TẾ GV: NGUYỄN THỊ BÍCH PHƯỢNG

LÂ P TRI NH WEB ASP.NET

BUILDING A VIETNAMESE DIALOG MECHANISM FOR V-DLG~TABL SYSTEM

NHÚNG. Vi ñiều khiển BM Kỹ Thuật ðiện Tử - ðh Bách Khoa TP.HCM 2

Bộ môn HTMT&TT, Khoa Công Nghệ Thông Tin và TT, ĐH Cần Thơ

Entity Framework (EF)

Chương 5. Network Layer. Phần 1 - Địa chỉ IPv4. Tài liệu : Forouzan, Data Communication and Networking

HƯỚNG DẪN SỬ DỤNG PLESK PANEL

Cụ thể những công việc mà AndroidManifest.xml thực hiện: - Đặt tên cho Java package của ứng dụng.

STACK và QUEUE. Lấy STACK

HỆ THỐNG FILE TRÊN PC

Nhấn nút New để tạo 1 biến mới Trang 17

Bài Thực hành Asp.Net - Buổi 1 - Trang: 1

HƯỚNG DẪN SỬ DỤNG HỆ THỐNG CẬP NHẬT CHỨNG THƯ SỐ HOTLINE:

B5: Time to coding. Tới thư mục src/example.java và thay đổi nội dung file như sau: Mã: package at.exam;

Tình huống 1: PPPoE với Username và Password

1 Bước 1: Test thử kit LaunchPad.

BÀI TẬP THỰC HÀNH LẬP TRÌNH WINDOWS C#

Khoa KH & KTMT Bộ môn Kỹ Thuật Máy Tính

SIEMENS INDUSTRIAL NETWORKS

LAB IP SLA Bài 1. Bùi Quốc Kỳ ***

BÀI 6 LÀM VIỆC VỚI THÀNH PHẦN MỞ RỘNG CỦA CSS3

HƯỚNG DẪN CÁCH SỬ DỤNG WINDOWS MOVIE MAKER

Preface. Journal of Physics: Conference Series. Related content PAPER OPEN ACCESS. To cite this article: 2016 J. Phys.: Conf. Ser.

Exceptions. Outline 7/31/2012. Exceptions. Exception handling is an important aspect of objectoriented. Chapter 10 focuses on:

TỔNG QUAN VỀ.NET VÀ C#

Giáo trình này được biên dịch theo sách hướng dẫn của Sun Light. Vì là hướng dẫn kỹ thuật, trong này những thuật ngữ kỹ thuật bằng tiếng Anh tôi chỉ

SOFTWARE ENGINEERING. Topics covered 1/20/2015. Chapter 6 Software Architecture Design

Chương 7. Application Layer. Tài liệu : Forouzan, Data Communication and Networking

I. Hướng Dẫn Đăng Nhập:

Cài đặt và cấu hình StarWind iscsi trên Windows. iscsi SAN là gì?

NỘI DUNG ÔN TẬP MÔN HỆ CƠ SỞ DỮ LIỆU

Hướng Dẫn Thực Hành Tập tin & Thư mục

Cập nhật ResultSet trong JDBC

CẤU TRÚC DỮ LIỆU NÂNG CAO

Lecture 12. Trees (1/2) Nội dung bài học:

GIẢI THUẬT ĐỊNH TUYẾN (ROUTING ALGORITHM)

Kỹ thuật thu nhỏ đối tượng trong Design (Layout)

LẬP TRÌNH TRÊN MÔI TRƯỜNG WINDOWS ADO.NET

Gii thiu v lp trình MVC vi Agavi, Phn 1: M ra th gii hoàn toàn mi vi Agavi

Bài 13: C++11. EE3490: Kỹ thuật lập trình HK1 2017/2018 TS. Đào Trung Kiên ĐH Bách khoa Hà Nội

Nội dung chính của chương. Các công nghệ đĩa cứng Cấu tạo vật lý của đĩa cứng Cấu tạo logic của đĩa cứng Cài đặt đĩa cứng như thế nào?

CU TRÚC D LIU VÀ GII THUT Câu 1. Vic thêm nút có vùng giá tr là = 45 vào cây nh phân tìm kim cân b ng sau ây s làm cho cây mt cân b ng.

Mạng máy tính - Computer Network: Hệ. Giao thức - Protocol:

THAO TÁC VỚI TẬP TIN TRONG C++

CHƯƠNG VII CASCADING STYLE SHEET-CSS

B3: Bên khung Package Explore bên trái đi tới thư mục res, bạn sẽ thấy có 3 thư mục con:

dụng một chính sách, điều này giúp dễ dàng quản lý và cung cấp tính năng Load Balancing (cân bằng tải) phục vụ tốt hơn các yêu cầu của tổ chức.

SIMULATE AND CONTROL ROBOT

LẬP TRÌNH TRÊN MÔI TRƯỜNG WINDOWS *** ADO.NET

Đa ngôn ngữ (Internationalization) trong Servlet

TÀI LIỆU HƯỚNG DẪN SỬ DỤNG HOSTING PLESK PANEL

Hướng dẫn cài đặt FPT

Tạo repository mới. The working tree. The staging index. Lệnh git init tạo một repository loại git. tại thư mục hiện tại: $ git init

Tröôøng Ñaïi Hoïc Baùch Khoa Tp.HCM LẬP TRÌNH MINICHAT. Bài giảng 3. Trang1. Khoa Khoa Học Và Kỹ Thuật Máy Tính

biến Global có thể được áp dụng cho tất cả các extension trong tất cả các context trong Dialplan.

Bài 7: Các cấu trúc điều khiển

Chương 6. Transport Layer. Tài liệu : Forouzan, Data Communication and Networking

Khoa Công Nghệ Thông Tin Trường Đại Học Cần Thơ. Những hỗ trợ tiên tiến khác của SQL. Đỗ Thanh Nghị

HƯỚNG DẪN QUẢN TRỊ HỆ THỐNG

// handle of dialog box

PHÁT TRIỂN ỨNG DỤNG WEB

Supervisor: Dr. Pham Minh Duc Class code: TS0813T1 Class

BÀI THỰC HÀNH SỐ 1. Quản trị tập tin: 1/ Tạo các thư mục sau: Bài tập thực hành linux Linuxlab. bt1 bt11 bt111. bt121. bt12. bh1 bh11 bh111.

Các kiểu định địa chỉ họ MSC-51

Câu 1: (2 điểm) So sách giữa 2 đối tượng Response và Request. Cho ví dụ minh hoạ.

Time Picker trong Android

Bài 10: Cấu trúc dữ liệu

BUREAU VERITAS VIETNAM - HCM Head Office

B9: Việc cuối cùng cần làm là viết lại Activity. Tới Example.java và chỉnh sửa theo nội dung sau: Mã: package at.exam;

ĐỀ CƯƠNG CHI TIẾT HỌC PHẦN

Môn Học: Cơ Sở Dữ Liệu 2. Chương 3 LẤY DỮ LIỆU TỪ NHIỀU NGUỒN

Khối: Cao Đẳng nghề và Trung Cấp Năm 2009

TÀI LIỆU THỰC HÀNH MÔN CƠ SỞ DỮ LIỆU NÂNG CAO

Tính kế thừa-2. Bởi: Thanh Hiền Vũ. Định nghĩa lại các thành viên lớp cơ sở trong một lớp dẫn xuất:

21/2013/TT-NHNN Ha Noi, ngay 09 thcing 9 nom Can cir Ludt Ngan hang Nha nu& Viet Nam so 46/2010/QH12 ngay 16 thong 6 nom 2010;

LẬP TRÌNH WINDOWS FORM VỚI CÁC CONTROL NÂNG CAO (Các control trình bày dữ liệu dưới dạng danh sách)

An Phu ward, My Duc District, Ha Noi

METAPOST. 1.1 Cấu trúc file Metapost. 1.2 Cấu trúc trong Preamble. beginfig(...) endfig;... extra_beginfig(...) extra_endfig... begingraph(...

Bài tập lớn số 1. Giả lập bộ định thời

Transcription:

Under The Sea Documentation Release 1.1.4 Vu Anh Jan 08, 2018

Notes 1 Underthesea - Vietnamese NLP Toolkit 3 2 Credits 7 3 History 9 4 word_sent 11 5 pos_tag 13 6 chunking 15 7 ner 17 8 classify 19 9 sentiment 21 10 Indices and tables 23 i

ii

Under The Sea Documentation, Release 1.1.4 Vietnamese NLP Toolkit Notes 1

Under The Sea Documentation, Release 1.1.4 2 Notes

CHAPTER 1 Underthesea - Vietnamese NLP Toolkit Documentation: https://underthesea.readthedocs.io Live demo: underthesea app Facebook Page: https://www.facebook.com/undertheseanlp/ 1.1 Installation To install underthesea, simply: $ pip install underthesea==1.1.6rc2 Satisfaction, guaranteed. 1.2 Usage 1. Word Segmentation 2. POS Tagging 3. Chunking 4. Named Entity Recognition 5. Text Classification 6. Sentiment Analysis 3

Under The Sea Documentation, Release 1.1.4 1.2.1 1. Word Segmentation >>> # -*- coding: utf-8 -*- >>> from underthesea import word_sent >>> sentence = u"chúng ta thng nói dn Rau sch, Rau an toàn d phân bit vi các rau bình thng bán ngoài ch." >>> word_sent(sentence) [u"chúng ta", u"thng", u"nói", u" dn", u"rau sch", u",", u"rau", u"an toàn", u" d", u "phân bit", u"vi", u"các", u"rau", u"bình thng", u"bán", u"ngoài", u"ch", u"."] >>> word_sent(sentence, format="text") u'chúng_ta thng nói dn Rau_sch, Rau an_toàn d phân_bit vi các rau bình_thng bán ngoài ch.' 1.2.2 2. POS Tagging >>> # -*- coding: utf-8 -*- >>> from underthesea import pos_tag >>> text = u"ch tht chó ni ting TP H Chí Minh b truy quét" >>> pos_tag(text) [(u'ch', 'N'), (u'tht', 'N'), (u'chó', 'N'), (u'ni ting', 'A'), (u'', 'E'), (u'tp HCM', 'Np'), (u'b', 'V'), (u'truy quét', 'V')] 1.2.3 3. Chunking >>> # -*- coding: utf-8 -*- >>> from underthesea import chunk >>> text = u"bác sĩ bây gi có th thn nhiên báo tin bnh nhân b ung th?" >>> chunk(text) [(u'bác sĩ', 'N', 'B-NP'), (u'bây gi', 'P', 'I-NP'), (u'có th', 'R', 'B-VP'), (u'thn nhiên', 'V', 'I-VP'), (u'báo tin', 'N', 'B-NP'), (u'bnh nhân', 'N', 'I-NP'), (u'b', 'V', 'B-VP'), (u'ung th', 'N', 'I-VP'), (u'?', 'CH', 'O')] 1.2.4 4. Named Entity Recognition >>> # -*- coding: utf-8 -*- >>> from underthesea import ner >>> text = u"cha tit l lch trình ti Vit Nam ca Tng thng M Donald Trump" 4 Chapter 1. Underthesea - Vietnamese NLP Toolkit

Under The Sea Documentation, Release 1.1.4 >>> ner(text) [('Cha', 'R', 'O', 'O'), ('tit l', 'V', 'B-VP', 'O'), ('lch trình', 'V', 'B-VP', 'O'), ('ti', 'E', 'B-PP', 'O'), ('Vit Nam', 'Np', 'B-NP', 'B-LOC'), ('ca', 'E', 'B-PP', 'O'), ('Tng thng', 'N', 'B-NP', 'O'), ('M', 'Np', 'B-NP', 'B-LOC'), ('Donald', 'Np', 'B-NP', 'B-PER'), ('Trump', 'Np', 'B-NP', 'I-PER')] 1.2.5 5. Text Classification $ pip install Cython $ pip install future scipy numpy scikit-learn $ pip install -U fasttext --no-cache-dir --no-deps --force-reinstall $ underthesea data Usage >>> # -*- coding: utf-8 -*- >>> from underthesea import classify >>> classify("hlv du tiên Premier League b sa thi sau 4 vòng du") ['The thao'] >>> classify("hi dng t vn kinh doanh Asean vinh danh gii thng quc t") ['Kinh doanh'] >>> classify("ðánh giá rp hát ti gia Samsung Soundbar Sound+ MS750") ['Vi tinh'] 1.2.6 6. Sentiment Analysis $ pip install future scipy numpy scikit-learn==0.19.0 joblib Usage >>> # -*- coding: utf-8 -*- >>> from underthesea import sentiment >>> sentiment("gi my ln mà lúc nào cũng là các chuyên viên dang bn ht ") ('CUSTOMER SUPPORT#NEGATIVE',) >>> sentiment("bidv cho vay hay ko phu thuoc y thich cua thang tham dinh, ko co quy dinh ro rang") ('LOAN#NEGATIVE',) 1.3 Up Coming Features Text to Speech Automatic Speech Recognition Machine Translation Dependency Parsing 1.3. Up Coming Features 5

Under The Sea Documentation, Release 1.1.4 1.4 Contributing Do you want to contribute with underthesea development? Great! Please read more details at CONTRIBUTING.rst. 6 Chapter 1. Underthesea - Vietnamese NLP Toolkit

CHAPTER 2 Credits 2.1 Development Lead Vu Anh <brother.rain.1024@gmail.com> 2.2 Contributors Bui Nhat Anh <buinhatanh1208@gmail.com> Doan Viet Dung <doanvietdung273@gmail.com> 7

Under The Sea Documentation, Release 1.1.4 8 Chapter 2. Credits

CHAPTER 3 History 3.1 1.1.6 (2017-12-26) New feature: aspect sentiment analysis Integrate with languageflow 1.1.6 Fix bug tokenize string with = (#159) 3.2 1.1.5 (2017-10-12) New feature: named entity recognition Refactor and update model for word_sent, pos_tag, chunking 3.3 1.1.4 (2017-09-12) New feature: text classification [bug] Fix Text error [doc] Add facebook link 3.4 1.1.3 (2017-08-30) Add live demo: https://underthesea.herokuapp.com/ 9

Under The Sea Documentation, Release 1.1.4 3.5 1.1.2 (2017-08-22) Add dictionary 3.6 1.1.1 (2017-07-05) Support Python 3 Refactor feature_engineering code 3.7 1.1.0 (2017-05-30) Add chunking feature Add pos_tag feature Add word_sent feature, fix performance Add Corpus class Add Transformer classes Integrated with dictionary of Ho Ngoc Duc Add travis-ci, auto build with PyPI 3.8 1.0.0 (2017-03-01) First release on PyPI. First release on Readthedocs 10 Chapter 3. History

CHAPTER 4 word_sent underthesea.word_sent.word_sent(sentence, format=none) Vietnamese word segmentation Parameters sentence ({unicode, str}) raw sentence Returns tokens tagged sentence Return type list of text Examples >>> # -*- coding: utf-8 -*- >>> from underthesea import word_sent >>> sentence = "Bác sĩ bây gi có th thn nhiên báo tin bnh nhân b ung th" >>> word_sent(sentence) ['Bác sĩ', 'bây gi', 'có th', 'thn nhiên', 'báo tin', 'bnh nhân', 'b', 'ung th'] >>> word_sent(sentence, format="text") 'Bác_sĩ bây_gi có_th thn_nhiên báo_tin bnh_nhân b ung_th' 11

Under The Sea Documentation, Release 1.1.4 12 Chapter 4. word_sent

CHAPTER 5 pos_tag underthesea.pos_tag.pos_tag(sentence, format=none) Vietnamese POS tagging Parameters sentence ({unicode, str}) Raw sentence Returns tokens tagged sentence Return type list of tuple with word, pos tag Examples >>> # -*- coding: utf-8 -*- >>> from underthesea import pos_tag >>> sentence = "Ch tht chó ni ting TPHCM b truy quét" >>> pos_tag(sentence) [('Ch', 'N'), ('tht', 'N'), ('chó', 'N'), ('ni ting', 'A'), ('', 'E'), ('TPHCM', 'Np'), ('b', 'V'), ('truy quét', 'V')] 13

Under The Sea Documentation, Release 1.1.4 14 Chapter 5. pos_tag

CHAPTER 6 chunking underthesea.chunking.chunk(sentence, format=none) Vietnamese chunking Parameters sentence ({unicode, str}) raw sentence Returns tokens tagged sentence Return type list of tuple with word, pos tag, chunking tag Examples >>> # -*- coding: utf-8 -*- >>> from underthesea import chunk >>> sentence = "Nghi vn 4 thi th Triu Tiên trôi dt b bin Nht Bn" >>> chunk(sentence) [('Nghi vn', 'N', 'B-NP'), ('4', 'M', 'B-NP'), ('thi th', 'N', 'B-NP'), ('Triu Tiên', 'Np', 'B-NP'), ('trôi dt', 'V', 'B-VP'), ('b bin', 'N', 'B-NP'), ('Nht Bn', 'Np', 'B-NP')] 15

Under The Sea Documentation, Release 1.1.4 16 Chapter 6. chunking

CHAPTER 7 ner underthesea.ner.ner(sentence, format=none) Location and classify named entities in text Parameters sentence ({unicode, str}) raw sentence Returns tokens tagged sentence Return type list of tuple with word, pos tag, chunking tag, ner tag Examples >>> # -*- coding: utf-8 -*- >>> from underthesea import ner >>> sentence = "Ông Putin ca ngi nhng thành tu vĩ di ca Liên Xô" >>> ner(sentence) [('Ông', 'Nc', 'B-NP', 'O'), ('Putin', 'Np', 'B-NP', 'B-PER'), ('ca ngi', 'V', 'B-VP', 'O'), ('nhng', 'L', 'B-NP', 'O'), ('thành tu', 'N', 'B-NP', 'O'), ('vĩ di', 'A', 'B-AP', 'O'), ('ca', 'E', 'B-PP', 'O'), ('Liên Xô', 'Np', 'B-NP', 'B-LOC')] 17

Under The Sea Documentation, Release 1.1.4 18 Chapter 7. ner

CHAPTER 8 classify Install dependencies and download default model $ pip install Cython $ pip install future scipy numpy scikit-learn $ pip install -U fasttext --no-cache-dir --no-deps --force-reinstall $ underthesea data underthesea.classification.classify(x, domain=none) Text classification Parameters X ({unicode, str}) raw sentence domain ({None, 'bank'}) domain of text None: general domain bank: bank domain Returns tokens categories of sentence Return type list Examples >>> # -*- coding: utf-8 -*- >>> from underthesea import classify >>> sentence = "HLV ngoi dòi gn t mi tháng dn dt tuyn Vit Nam" >>> classify(sentence) ['The thao'] 19

Under The Sea Documentation, Release 1.1.4 >>> sentence = "Tôi rt thích cách phc v ca nhân viên BIDV" >>> classify(sentence, domain='bank') ('CUSTOMER SUPPORT',) 20 Chapter 8. classify

CHAPTER 9 sentiment Install dependencies $ pip install future scipy numpy scikit-learn==0.19.0 joblib underthesea.sentiment.sentiment(x, domain=none) Sentiment Analysis Parameters X ({unicode, str}) raw sentence domain ({'bank'}) domain of text bank: bank domain Returns tokens sentiment of sentence Return type list Examples >>> # -*- coding: utf-8 -*- >>> from underthesea import sentiment >>> sentence = "Va smartbidv, va bidv online mà li k dùng chung 1 tài khon dăng nhp, rc ri!" >>> sentiment(sentence, domain='bank') ('INTERNET BANKING#NEGATIVE',) 21

Under The Sea Documentation, Release 1.1.4 22 Chapter 9. sentiment

CHAPTER 10 Indices and tables genindex modindex search 23

Under The Sea Documentation, Release 1.1.4 24 Chapter 10. Indices and tables

Index C chunk() (in module underthesea.chunking), 15 classify() (in module underthesea.classification), 19 N ner() (in module underthesea.ner), 17 P pos_tag() (in module underthesea.pos_tag), 13 S sentiment() (in module underthesea.sentiment), 21 W word_sent() (in module underthesea.word_sent), 11 25