Skip to content

Instantly share code, notes, and snippets.

View wannaphong's full-sized avatar

Wannaphong Phatthiyaphaibun wannaphong

View GitHub Profile
print("Hi")
using System;
public class MyProgram
{
public static void Main(String[] args)
{
int n;
int[] A = new int[4];
int[] B = new int[4];
int[] C = new int[4];
from openpyxl import load_workbook
wb = load_workbook(filename = 'sample.xlsx') #อ่านไฟล์ sample.xlsx
sheet_ranges = wb['hello'] #เรียกใช้ worksheet ที่ชื่อว่า hello
print(sheet_ranges['A1'].value) #อ่านค่าจากเซลส์ A1 ใน worksheet ของ hello
def hi():
print("สวัสดีชาวโลก")
import sys
from subprocess import call
def play(name):
if sys.platform == 'linux':
call(["ffplay",name])
elif sys.platform == 'darwin':
call(["afplay",name])
elif sys.platform == 'win32':
call(['start',name])
else:
สวัสดีชาวโลก
ผมเป็นคนไทย
สบายดีไหม
ทำอะไรอยู่อ่ะ
หิวข้าวแล้ว
เธอชอบกินข้าวมันไก่
เขาเพิ่งกลับจากโรงเรียน
พรุ่งนี้เป็นวันอะไร
มือถือของนายรุ่นอะไรอ่ะ
เราไปสั่งข้าวที่ร้านอาหารกันไหม
This file has been truncated, but you can view the full file.
1 “ _ PUNCT PUNCT_`` _ 27 punct _ _
2 แม้ _ ADP ADP_IN _ 10 mark _ _
3 ว่า _ ADP ADP_IN _ 2 fixed _ _
4 การเปลี่ยน _ VERB VERB_VV _ 10 csubj _ _
5 ไป _ PART PART_RP _ 4 compound:prt _ _
6 ใช้ _ VERB VERB_VV _ 4 xcomp _ _
7 ระบบ _ NOUN NOUN_NN _ 6 obj _ _
8 ดิจิตัล _ ADJ ADJ_JJ _ 7 amod _ _
9 เป็น _ AUX AUX_VC _ 10 cop _ _
10 สิ่ง _ NOUN NOUN_NN _ 27 advcl _ _
#Apache License 2.0
file_name="data" # ชื่อไฟล์คลังข้อมูล
import codecs
from pythainlp.tokenize import word_tokenize
from pythainlp.tag import pos_tag
from nltk.tokenize import RegexpTokenizer
import glob
import nltk
import re
#จัดการประโยคซ้ำ
from sklearn_crfsuite import scorers,metrics
from sklearn.metrics import make_scorer
from sklearn.model_selection import cross_validate,train_test_split
import sklearn_crfsuite
def doc2features(doc, i):
word = doc[i][0]
postag = doc[i][1]
# Features from current word
features={
'word.word': word,
@wannaphong
wannaphong / ner.py
Last active December 11, 2018 14:52
# Apache License 2.0
file_name="data" # ชื่อไฟล์คลังข้อมูล
import codecs
from pythainlp.tokenize import word_tokenize
from pythainlp.tag import pos_tag
from nltk.tokenize import RegexpTokenizer
import glob
import nltk
import re
#จัดการประโยคซ้ำ