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

カベを壊せ!「機械学習」×「グラフデータベース」×「チャット」で繋ぐヒューマンリレーションシップ!!

Shogo Ichinose
December 15, 2018

 カベを壊せ!「機械学習」×「グラフデータベース」×「チャット」で繋ぐヒューマンリレーションシップ!!

Shogo Ichinose

December 15, 2018
Tweet

More Decks by Shogo Ichinose

Other Decks in Technology

Transcript

  1. Χ ϕ Λ յ ͤ ʂ ʮ ػ ց ֶ

    श ʯ × ʮ ά ϥ ϑ σ ʔ λϕʔε ʯ × ʮ ν ϟ ο τ ʯ Ͱ ܨ ͙ ώ ϡ ʔϚ ϯ Ϧ Ϩ ʔ γ ϣ ϯ γ οϓ ʂ ʂ # d e v b o o s t A - 1 0 # D re a m A r t s D re a m A r t s C o r p o r a t i o n 
 S h o g o I c h i n o s e https://images.nasa.gov/details-PIA04921.html
  2. #devboostA-10 #DreamArts • Ұϊ੉ ᠳޗ Shogo Ichinose • @rettar5 /

    @[email protected] • Angular / Swift • Mastodon Meetup at Tokyo
 EjectίϚϯυϢʔβʔձ S E L F - I N T R O D U C T I O N
  3. #devboostA-10 #DreamArts גࣜձࣾυϦʔϜɾΞʔπ ౦ژຊࣾ ( ौ୩۠ܙൺण ) ɹɹɹɹɹɹɹɹɹɹɹɹ ޿ౡຊࣾ (

    ޿ౡࢢத۠େखொ ) גࣜձࣾυϦʔϜɾΞʔπԭೄ ( ಹ೼ࢢ, ੴ֞ࢢ ) ເ૑৴ଉ(େ࿈)༗ݶެ࢘ ( தࠃେ࿈ ) ୅දऔక໾ࣾ௕ ࢁຊ޹ত 1996೥12݄ ઃཱ ελοϑ૯һ ໿270໊ • େ૊৫޲͚ITαʔϏεࣄۀ • ઌ୺ٕज़ɾϚʔέςΟϯάΛ༥߹ͤͨ͞
 γεςϜ։ൃɾίϯαϧςΟϯάࣄۀ
  4. #devboostA-10 #DreamArts D A - > S E R V

    I C E S & P R O D U C T S ͋ΒΏΔۀ຿ʹରԠ ίϛϡχέʔγϣϯΛϕʔεʹ ૊৫ɾਓɾࣾձ͕ ΑΓΑ͘ڠ૑͢ΔͨΊͷ αʔϏε & ϓϩμΫτ
  5. #devboostA-10 #DreamArts D A - > S E R V

    I C E S & P R O D U C T S
  6. #devboostA-10 #DreamArts H O W W I L L W

    E B R E A K T H E “ WA L L ” ? • ࡞ͬͨ΋ͷ͸ɺʮࠓ·ͰؔΘͬͨ͜ͱ͕ͳ͍ ͔ͭɺΩʔϫʔυΛ஌͍ͬͯΔਓΛ঺հ͢Δ νϟοτBOTʯ • ػցֶश × άϥϑσʔλϕʔε × νϟοτ Λ૊Έ߹Θ࣮ͤͯݱ
  7. #devboostA-10 #DreamArts Chiwawa Server Azure Cosmos DB
 (Graph Database) Chiwawa

    Application Flask Server Trained Models Python Scripts Python Scripts νϟοτBOTͷ࣮ݱʹ͋ͨΓɺ 6ͭͷٕज़Λ࢖͍·ͨ͠ɻ
  8. #devboostA-10 #DreamArts Cloud Services Local PC Chiwawa Server Azure Cosmos

    DB
 (Graph Database) Chiwawa Application Flask Server Trained Models Python Scripts Python Scripts DB΍νϟοτͷ৘ใ͸Ϋϥ΢υ্Ͱɺ ػցֶश΍ϨίϝϯυॲཧͳͲ͸ɺ ࣗ෼ͷPC಺ͰॲཧΛߦ͍ͬͯ·͢ɻ
  9. #devboostA-10 #DreamArts O V E R V I E W

    O F C H AT B O T • Step 1. σʔλ౤ೖɾֶशࡁΈϞσϧͷੜ੒ • άϥϑDB΁ͷσʔλΠϯϙʔτ • ౤ߘσʔλΛ࢖ֶͬͨशࡁΈϞσϧͷੜ੒ • Step 2. νϟοτBOTͰͷϢʔβϨίϝϯυॲཧ • άϥϑDBͱֶशࡁΈϞσϧ͔ΒϢʔβͷऔಘ • νϟοτBOTΛ࢖͍ɺϢʔβΛ঺հ
  10. #devboostA-10 #DreamArts S t e p 1 . σ ʔ

    λ ͷ ౤ ೖ 
 ֶ श ࡁ Έ Ϟ σϧ ͷ ੜ ੒
  11. #devboostA-10 #DreamArts S T E P 1 . P R

    E P R O C E S S I N G • άϥϑσʔλϕʔεͱ͸ͳʹ͔
  12. #devboostA-10 #DreamArts ಉظ ಉظ ্࢘ ෦Լ ্࢘ ෦Լ ্࢘ ෦Լ

    ্࢘ ෦Լ ্࢘ ෦Լ ޓ͍Λʮؔ܎ੑʯͱ͍͏ઢͰͭͳ͙͜ͱ͕Ͱ͖·͢ɻ ͜ͷϞσϧΛDBʹͨ͠ͷ͕άϥϑσʔλϕʔεͰ͢ɻ
  13. #devboostA-10 #DreamArts S T E P 1 . P R

    E P R O C E S S I N G • άϥϑσʔλϕʔεͱ͸ • ཁૉʢ௖఺ʣΛؔ܎ੑʢลʣͰܨ͍ͩϞσϧΛ ࣋ͭσʔλϕʔε • ΧʔφϏͷܦ࿏୳ࡧ΍ɺෆਖ਼ݕ஌ʢύφϚจॻ ͷղੳʣͳͲͰ׆༻ • Neo4j΍OrientDBɺAmazon Neptune΍Azure Cosmos DB౳
  14. #devboostA-10 #DreamArts User Group Tag • Id • Name Message

    • Id • Text • AttachmentTitle • AttachmentText • CreatedAt Reaction • Id • Name • Sentiment • CreatedAt • Id • Name • Id • Name Post Mention BelongsTo Mention Exists Exists AttachedTo Adds AttachedTo νϟοτͷσʔλΛ্ͷΑ͏ͳܗͰΠϯϙʔτ͠·ͨ͠ɻ
  15. #devboostA-10 #DreamArts User Group Tag • Id • Name Message

    • Id • Text • AttachmentTitle • AttachmentText • CreatedAt Reaction • Id • Name • Sentiment • CreatedAt • Id • Name • Id • Name Post Mention BelongsTo Mention Exists Exists AttachedTo Adds AttachedTo ྫ͑͹ɺʮϝοηʔδ͸Ϣʔβʹ౤ߘ͞Εͨʯͱ͍͏ؔ܎Λɺ
  16. #devboostA-10 #DreamArts User Group Tag • Id • Name Message

    • Id • Text • AttachmentTitle • AttachmentText • CreatedAt Reaction • Id • Name • Sentiment • CreatedAt • Id • Name • Id • Name Post Mention BelongsTo Mention Exists Exists AttachedTo Adds AttachedTo ʮϢʔβ͸άϧʔϓʹॴଐ͢ΔʯͳͲͷؔ܎Λ࣋ͪ·͢ɻ
  17. #devboostA-10 #DreamArts S T E P 1 . P R

    E P R O C E S S I N G • Doc2Vec • ࣅ͍ͯΔจॻΛ෼ྨɾऔಘ͢Δ͜ͱ͕Ͱ͖Δػցֶश • e.g.: Wikipediaͷσʔλ͔ΒֶशࡁΈϞσϧΛੜ੒ ͠ɺʮΩʔϫʔυʯ͔Βʮࣅ͍ͯΔهࣄʯΛऔಘ͢Δ • ͋Β͔͡Ίج४ͱͳΔจॻΛར༻ͯ͠ɺֶशࡁΈϞσ ϧΛੜ੒͢Δඞཁ͕͋Δ
  18. #devboostA-10 #DreamArts S T E P 1 . P R

    E P R O C E S S I N G • Doc2Vec • จॻΛϕΫτϧͱͯ͠ѻ͍ɺ͍ۙϕΫτϧΛ࣋ͭจॻΛ ग़ྗ • จॻΛϕΫτϧͱͯ͠ѻ͏ͨΊʹɺWord2VecΛར༻ • Word2Vec • ୯ޠΛϕΫτϧͱͯ͠ѻ͍ɺ͍ۙϕΫτϧΛ࣋ͭ୯ޠΛ ग़ྗ • ʮ͋Δ୯ޠAͷपลʹผͷ୯ޠB͕ग़ݱ͢Δ֬཰ʯΛֶश
  19. #devboostA-10 #DreamArts S T E P 1 . P R

    E P R O C E S S I N G Ͷ͜ɹ͕ɹʹΌʔΜɹͱɹͳ͘ ΤϯδχΞɹ͕ɹʹΌʔΜɹͱɹͳ͘ ʮ˓˓͕ʹΌʔΜͱͳ͘ʯͱ͍͏จষͰɺ
 ˓˓ʹ Ͷ͜ ΍ ΤϯδχΞ ؚ͕·ΕΔ֬཰Λֶश ΤϯδχΞ ≒ Ͷ͜ ͜ͷ৔߹ Ͷ͜ ͱ ΤϯδχΞ ͸ಉ͡จ๏Ͱ࢖ΘΕΔ Word2VecͰ͸ ͱֶश͞Ε·͢ɻ
  20. #devboostA-10 #DreamArts S T E P 1 . P R

    E P R O C E S S I N G • User2Vec • Doc2Vec͸ࣅ͍ͯΔจॻΛऔಘ͢Δ࢓૊Έ • νϟοτͷ౤ߘσʔλΛจॻͱஔ͖׵͑Δͱɺ
 ͋ΔΩʔϫʔυΛ౤ߘͨ͜͠ͱ͕͋Δਓ
 ʢ˺ΩʔϫʔυΛ஌͍ͬͯΔਓʣ͕औಘͰ͖Δ • ୯ޠͷΏΒ͗౳΋Word2VecͰٵऩՄೳ
  21. #devboostA-10 #DreamArts S T E P 1 . P R

    E P R O C E S S I N G େྔͷ౤ߘΛֶश ͋Δ಺༰Λೖྗ ࣅͨ౤ߘΛͨ͠ਓΛग़ྗ
  22. #devboostA-10 #DreamArts Train & Create Models Preprocessing for ML Doc2Vec

    Doc2VecΛԠ༻ͨ͠User2VecΛ࢖͍ɺ ࣄલʹֶशࡁΈϞσϧΛ࡞੒͓͖ͯ͠·͢ɻ
  23. #devboostA-10 #DreamArts S t e p 2 . ν ϟ

    ο τ B O T Ͱ ͷ 
 Ϣʔ β Ϩί ϝ ϯ υ ॲ ཧ
  24. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N
  25. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N 7VF   Ұϊ੉ᠳޗ
  26. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N • Webhook • νϟοτBOTʹϝοηʔδ͕ૹΒΕΔͱɺ༧Ίઃఆ͞Ε ͨURL΁ϝοηʔδͷ಺༰Λసૹ͢Δ࢓૊Έ • Flask • γϯϓϧͳPythonͷϚΠΫϩWebϑϨʔϜϫʔΫ • ࠓճ͸WebhookΛड͚ͨࡍʹϝοηʔδຊจΛऔಘ ͠ɺޙଓͷϨίϝϯυॲཧΛݺͼग़͢
  27. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N • User2Vec • FlaskͰऔಘͨ͠ϝοηʔδΛܗଶૉղੳΛ ͯ͠෼͔ͪॻ͖ʹ͠ɺStep 1.Ͱੜ੒ֶͨ͠ शࡁΈϞσϧ͔ΒϢʔβΛऔಘ • ͜ͷͱ͖ɺϕΫτϧͷྨࣅείΞʢίαΠϯ ྨࣅ౓ʣ΋औಘͰ͖Δ
  28. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N • άϥϑσʔλϕʔε • ϝοηʔδͷ౤ߘऀͱɺػցֶशͰऔಘͨ͠ Ϣʔβͱͷڑ཭Λܭࢉ • ϓϩάϥϜ͔ΒσʔλϕʔεΛૢ࡞͢Δʹ͸
 Gremlinͱ͍͏ΠϯλʔϑΣΠεΛར༻
  29. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N • Apache TinkerPop Gremlin • ϑϨʔϜϫʔΫͰ͋ΔApache TinkerPopͷάϥϑ
 τϥόʔαϧݴޠʢDSLʣ • Neo4jɺOrientDBɺAmazon NeptuneɺAzure Cosmos DB౳ͷଟ͘ͷάϥϑσʔλϕʔε͕αϙʔτ • Neo4jͷCypher Query౳ʹൺ΂ɺ௚ײతͳૢ࡞͕Մೳ
  30. #devboostA-10 #DreamArts User Reaction • Id • Name • Id

    • Name • Sentiment • CreatedAt Message • Id • Text • AttachmentTitle • AttachmentText • CreatedAt >g.V().hasLabel(‘User’).has(‘Id’, ‘rettar5’) ࣗ෼ʢid = ‘rettar5’ʣͷ৘ใΛऔಘ͢Δͱ͖ʹ͸…
  31. #devboostA-10 #DreamArts User Reaction Post • Id • Name •

    Id • Name • Sentiment • CreatedAt Message • Id • Text • AttachmentTitle • AttachmentText • CreatedAt >g.V().hasLabel(‘User’).has(‘Id’, ‘rettar5’)
 .outE(‘Post’).inV() ࣗ෼ʢid = ‘rettar5’ʣ͕౤ߘͨ͠ϝοηʔδΛऔಘ͢Δͱ͖ʹ͸…
  32. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N • Ϣʔβಉ࢜ͷؔ܎ੑ • Ϣʔβಉ࢜ͷίϛϡχέʔγϣϯͷྔ
 ʹ Ϣʔβಉ࢜ͷؔ܎είΞ • ίϛϡχέʔγϣϯ͕ଟ͚Ε͹ଟ͍΄Ͳɺ஥͕͍ ͍ؔ܎ͱ൑ఆ • ࠓճؔ܎είΞΛଌΔͨΊʹ࢖͏ίϛϡχέʔγϣ ϯύλʔϯ͸4छྨ
  33. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N @all: 15೔ͷࢿྉΛߋ৽͠·ͨ͠ɺ
 ϨϏϡʔΛ͓ئ͍͠·͢ʂ άϧʔϓશһʹϝοηʔδΛ౤ߘ
  34. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N @ੴా྄݈: 15೔ͷࢿྉΛ
 ߋ৽͠·ͨ͠ɺ
 ϨϏϡʔΛ͓ئ͍͠·͢ʂ ૬खͷ໊લΛ͚ͭͯϝοηʔδΛ౤ߘ
  35. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N 15೔ͷࢿྉΛߋ৽͠·ͨ͠ɺ
 ϨϏϡʔΛ͓ئ͍͠·͢ʂ 1ର1ͰϝοηʔδΛ౤ߘ
  36. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N 15೔ͷࢿྉΛߋ৽͠·ͨ͠ɺ
 ϨϏϡʔΛ͓ئ͍͠·͢ʂ ౤ߘͨ͠ϝοηʔδ΁ϦΞΫγϣϯ
  37. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N • ֤ύλʔϯʹॏΈ෇͚Λߦ͍ɺ߹ܭͷؔ܎ είΞ͕௿͍ਓʢ㲈 ؔΘͬͨ͜ͱ͕ͳ͍ ਓʣΛݟ͚ͭग़͢
  38. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N • Ϩίϝϯσʔγϣϯϝοηʔδͷ౤ߘ • ؔ܎είΞ͕௿͍͔ͭɺྨࣅείΞ͕ߴ͍ ॱʹฒͼସ͑ • ্Ґ3ਓͷ৘ใΛ஌࿩ྠʢνϟοτʣαʔό ʹૹΓɺؔΘͬͨ͜ͱ͕ͳ͍ɺΩʔϫʔυ Λ஌͍ͬͯΔਓͱͯ͠ϨίϝϯυΛ౤ߘ
  39. #devboostA-10 #DreamArts S T E P 2 . U S

    E R R E C O M M E N D AT I O N 7VF   Ұϊ੉ᠳޗ ੴా͞ΜɺୌՖ͞Μɺ౻ຊ͞Μ͕ʮ7VFʯ ʹ͍ͭͯৄ͍͠Α͏Ͱ͢ɻ ϝοηʔδΛૹͬͯΈ·ͤΜ͔ʁ  Ϣʔβ঺հ#05 ࣗ෼ͷ౤ߘʹରͯ͠ɺνϟοτBOT͕ϢʔβΛ঺հͯ͘͠ΕΔʂ
  40. #devboostA-10 #DreamArts I N F U T U R E

    • νϟοτBOT͕໾ʹཱ͔ͬͨධՁ͢ΔͨΊͷ ࢓૊Έ • ΞΫςΟϒϥʔχϯάͷ࢓૊Έ • ϓϥΠόγʔɾηΩϡϦςΟͷ࢓૊Έ
  41. #devboostA-10 #DreamArts I N F U T U R E

    • ΞΫςΟϒϥʔχϯά • νϟοτͷσʔλ͸೔ʑ૿͑ଓ͚Δ • ։ൃ؀ڥͷαΠϩԽɺܧଓతͳֶशࡁΈ Ϟσϧͷߋ৽΍ϋΠύʔύϥϝʔλͷௐ੔ ʹ՝୊
  42. #devboostA-10 #DreamArts I N F U T U R E

    • Azure Machine Learning service • ػցֶश༻ͷϦιʔε֬อɺ࠷దͳΞϧΰϦζϜɾϋ Πύʔύϥϝʔλͷ୳ࡧɺσϓϩΠͳͲΛࣗಈԽ • ʮσʔλʯͱʮ΄͍݁͠ՌʯΛ༩͑Δͱɺ͢΂ͯࣗ ಈͰػցֶशͯ͠΋Β͑Δະདྷ΋ԕ͘ͳ͍ • ໰୊ղܾͷຊ࣭Ͱͳ͍ʮ؀ڥߏஙʯ΍ʮӡ༻ʯ౳ʹ ࣌ؒΛऔΒΕΔ͜ͱͳ͘ɺ΍Δ΂͖͜ͱ͕΍ΕΔΑ ͏ʹͳΔ
  43. #devboostA-10 #DreamArts I N F U T U R E

    • ϓϥΠόγʔɾηΩϡϦςΟ • ܦӦ΍ਓࣄʹؔΘΔ৘ใ͕౤ߘ͞Ε͍ͯΔ Մೳੑ͕͋Δ • ʮࣗ෼ͷϝοηʔδ͸ݟΒΕͨ͘ͳ͍ʯͱ ͍͏ਓ͕ग़ΔՄೳੑ͕͋Δ
  44. #devboostA-10 #DreamArts I N F U T U R E

    • ϓϥΠόγʔɾηΩϡϦςΟ • ݟΒΕͨ͘ͳ͍ͷ͸ϝοηʔδͷ಺༰ • ϝοηʔδΛૹͬͨͱ͍͏ࣄ࣮Λ࢖͏ͷ͸໰୊ͳ͍ • ؔ܎είΞͷਫ਼౓͸ҡ࣋ͭͭ͠ɺ࢖ͬͯ͸͍͚ͳ͍ ϝοηʔδ͸ϚεΩϯάͯ͠׆༻͢Δ • 1ର1ͷ΍ΓऔΓ΍ϒϥοΫϦετ౳Ͱલॲཧ
  45. #devboostA-10 #DreamArts C O N C L U S I

    O N • ۀ຿͕νϟοτϕʔεʹมΘͬͨ • ίϛϡχέʔγϣϯͷ෼ੳɾ׆༻͕ݱ࣮తʹ • ؾܰʹʮͪΐͬͱࢼͯ͠ΈΔʯ͜ͱͰ͖Δ࣌୅ • ػցֶश΍Ϋϥ΢υج൫ͳͲखܰʹ࢖͑ΔΑ͏ʹ • ͋Γ΋ͷΛ૊Έ߹ΘͤΔ͚ͩͰେ͖ͳ੒Ռ͕ग़ͤΔ • ৽ͨͳՁ஋ΛੜΉͨΊͷΞΠσΟΞ͕ॏཁ
  46. #devboostA-10 #DreamArts R E C R U I T M

    E N T O F S TA F F AT 
 T O K Y O / H I R O S H I M A / O K I N AWA υϦʔϜɾΞʔπ ࠾༻ https://recruit.dreamarts.co.jp