This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import face_recognition | |
picture_of_Steve_Jobs = face_recognition.load_image_file("Steve_Jobs_Headshot_2010-CROP.jpg") # ไฟล์ต้นแบบ | |
face_encoding = face_recognition.face_encodings(picture_of_Steve_Jobs)[0] # เข้ารหัสหน้าตา | |
unknown_picture = face_recognition.load_image_file("0x600.jpg") # ไฟล์ที่ต้องการตรวจสอบ | |
unknown_face_encoding = face_recognition.face_encodings(unknown_picture)[0] # เข้ารหัสหน้าตา | |
results = face_recognition.compare_faces([face_encoding], unknown_face_encoding) # ทำการเปรียบเทียบด้วย Face Recognition | |
if results[0] == True: | |
print("It's a picture of Steve Jobs!") | |
else: | |
print("It's not a Steve Jobs!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nltk.corpus import wordnet | |
class thaiwordnet: | |
def __init__(self): | |
self._wordnet = wordnet | |
def synsets(self, word, pos=None, lang="tha"): | |
return self._wordnet.synsets(lemma=word,pos=pos,lang=lang) | |
def synset(self,name_synsets): | |
return self._wordnet.synset(name_synsets) | |
def all_lemma_names(self,pos=None, lang="tha"): | |
return self._wordnet.all_lemma_names(pos=pos, lang=lang) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class='post-share-buttons'> | |
<iframe allowTransparency='true' expr:src='"https://www.facebook.com/plugins/like.php?href=" + data:post.canonicalUrl + "&layout=box_count&show_faces=false&width=100&action=like&font=arial&colorscheme=light"' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:55px; height:62px;'/> | |
<iframe allowTransparency='true' expr:src='"https://www.facebook.com/plugins/share_button.php?href=" + data:post.canonicalUrl + "&layout=box_count&show_faces=false&width=100&action=like&font=arial&colorscheme=light"' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:55px; height:62px;'/> | |
<br /> | |
<b:include data='post' name='shareButtons'/> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<provider | |
android:name="android.support.v4.content.FileProvider" | |
android:authorities="${applicationId}.provider" | |
android:exported="false" | |
android:grantUriPermissions="true"> | |
<meta-data | |
android:name="android.support.FILE_PROVIDER_PATHS" | |
android:resource="@xml/provider_paths"/> | |
</provider> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from spacy.lang.th import Thai | |
>>> nlp = Thai() | |
>>> text="คุณรักผมไหม" | |
>>> a = nlp(text) | |
>>> a | |
คุณรักผมไหม | |
>>> list(a) | |
[คุณ, รัก, ผม, ไหม] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""Implementation of Rapid Automatic Keyword Extraction algorithm. | |
As described in the paper `Automatic keyword extraction from individual | |
documents` by Stuart Rose, Dave Engel, Nick Cramer and Wendy Cowley. | |
Thai language by Mr.Wannaphong Phatthiyaphaibun <wannaphong@kkumail.com> | |
""" | |
import string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// เดติดต้นฉบับจาก http://vuthi.blogspot.com.au/2004/08/java.html | |
public String icu_word_segmentation(String txt){ | |
Locale thaiLocale = new Locale("th"); | |
BreakIterator boundary = BreakIterator.getWordInstance(thaiLocale); | |
boundary.setText(txt); | |
StringBuffer strout = new StringBuffer(); | |
int start = boundary.first(); | |
for (int end = boundary.next(); | |
end != BreakIterator.DONE; | |
start = end, end = boundary.next()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Hi") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |