Upgrade to Pro — share decks privately, control downloads, hide ads and more …

タイ語のサジェストを日本人の俺が頑張った道のり

Ryotaro Ko
December 06, 2019

 タイ語のサジェストを日本人の俺が頑張った道のり

第34回Elasticsearch勉強会「LT&忘年会」( https://www.meetup.com/ja-JP/Tokyo-Elastic-Fantastics/events/266551992/ ) でのLTの公開用スライドです。

Ryotaro Ko

December 06, 2019
Tweet

More Decks by Ryotaro Ko

Other Decks in Programming

Transcript

  1. ͢͢Ί͔ͨ ͜ͷαΠΫϧΛͻͨ͢Β܁Γฦ͢ײ͡ʹ ໦ ۚ ౔ ೔ ݄ Ր ਫ ɾ࣮૷

    ɾ2" ɾϦϦʔε ɾݱ஍ϝϯόʔ࢖༻ײௐࠪ ɾϑΟʔυόοΫ Քಇ͕࣌ؒݶΒΕΔ 壁
  2. 3FUUZ(MPCBMγεςϜ໘ &MBTUJDTFBSDIඪ४4VHHFTUFSͰ͸ͳ͘௨ৗͷ*OEFYΛ࢖ͬͯ*ODSFNFOUBM4FBSDI  ӳޠλΠޠ޿౦ޠΛಉ࣌ʹݕࡧ͍ͯ͠Δ  ˞(MPCBMϦϦʔε౰࣌ͷཁٻʹجͮ͘   { ※ΠϝʔδͰ͢

    "query": { "multi_match": { "query": "ΒͿΏʔ", "fields": [ "restaurant_name-en", "restaurant_name-th", "restaurant_name-zh_cn" ] } } 壁 壁③ ٕज़ͷน
  3. 3FUUZ(MPCBMγεςϜ໘  ݕূ؀ڥʹ๡͍͠  ΞϓϦ༻"1*αʔόʔTUHͷΈ  &MBTUJDTFBSDIΫϥελຊ൪ͷΈ  ݕূͯ͠΋Β͏ʹ΋ݱ஍ϝϯόʔͷٕज़తαϙʔτ͕ࠔ೉ 壁

    壁 壁 ໦ ۚ ౔ ೔ ݄ Ր ਫ ɾ࣮૷ ɾ2" ɾݱ஍ϝϯόʔ࢖༻ײௐࠪ ɾϑΟʔυόοΫ ΍͹ͦ͏ͳػೳ ɾTUHϦϦʔεɾຊ൪(PPS/P(P
  4. 3FUUZ(MPCBMγεςϜ໘  ݕূ؀ڥʹ๡͍͠  ΞϓϦ༻"1*αʔόʔTUHͷΈ  &MBTUJDTFBSDIΫϥελຊ൪ͷΈ  ݕূͯ͠΋Β͏ʹ΋ݱ஍ϝϯόʔͷٕज़తαϙʔτ͕ࠔ೉ 壁

    壁 壁 ໦ ۚ ౔ ೔ ݄ Ր ਫ ɾ࣮૷ ɾ2" ɾݱ஍ϝϯόʔ࢖༻ײௐࠪ ɾϑΟʔυόοΫ ΍͹ͦ͏ͳઃఆ ɾຊ൪൓ө
 ɾ଎߈Ͱ໭͢PS(P ΍͹ͦ͏ͳػೳ ɾTUHϦϦʔεɾຊ൪(PPS/P(P
  5. ࠷ޙͷɺ&MBTUJDTFBSDI  "edge_ngram"ϕʔεͷӳޠϑΟʔϧυͱ෼͔ͪॻ͖"thai_tokenizer"ϕʔεͷ
 ϑΟʔϧυΛ"multi_match"Ͱݕࡧͯͨ͠ ˠࣙॻϕʔε෼͔ͪॻ͖"icu_tokeinzer"Ͱ෼཭ͨ͋͠ͱ"edge_ngram"ͷ
 GJMUFSͰUPLFOJ[F͢Δ߹͍ͷࢠBOBMZ[FSΛఆٛͨ͠
 壁 "filter": { "engram_filter":

    { "type": "edge_ngram", "min_gram": "1", "max_gram": "12" } } "analyzer": { "thai_engramlike_analyzer": { "filter": [ "engram_filter" ], "char_filter": [ "icu_normalizer" ], "type": "custom", "tokenizer": "icu_tokenizer" } }
  6. Image Credits: Olesya Tseytlin/Shutterstock.com, "fritened cat". [Proprietary] Jean Beaufort, "Orion

    Nebula". https://www.publicdomainpictures.net/en/view-image.php?image=210557 [PD] 5IBOLZPVGPS-JTUFOJOH