Dieser Artikel wurde von unseren Ciscos-Kollegen als Tag 10 des Adventskalenders 2019 von Cisco Systems Japan veröffentlicht. Klicken Sie hier für frühere Kalender Version 2017: https://qiita.com/advent-calendar/2017/cisco -> Verteilte Richtlinien-Tags mit LISP und TrustSec mit CML / VIRL ausprobiert Ausgabe 2018: https://qiita.com/advent-calendar/2018/cisco -> Ich habe versucht, das SaaS-Typüberwachungs- / Verhaltenserkennungs-Tool von Cisco für die Überwachung von Umgebungen mit mehreren Clouds zu verwenden
In diesem Jahr, meinem dritten Jahr bei der Firma (Adventskalender nahm auch drei Jahre in Folge teil!), Habe ich mich mit "Maschinelles Lernen / KI" befasst, daher werde ich ** MindMeld ** als ein Thema schreiben, das der Technologie von Cisco entspricht.
Mindmeld ist eine branchenbasierte interaktive KI-Plattform, die Cisco 2017 erworben hat. Dieses Entwickler-Toolkit wurde im Mai 2019 als Open Source veröffentlicht. Um eine etwas detailliertere Erklärung zu geben, verwendet MindMeld den MindMeld-Bot, der erstellt wurde, um zu reflektieren, was Entwickler und Benutzer tun möchten (Absicht): "Ich möchte XX tun", "Ich möchte, dass Sie XX finden", "△" Dies ist ein anpassbares Toolkit zur Erfüllung von Anforderungen wie "Ich möchte, dass Sie die Informationen von △ abrufen" im Gespräch mit dem Bot. Eine ausführliche Erklärung wird als [dieser Blog] veröffentlicht (https://www.google.co.jp/amp/s/gblogs.cisco.com/jp/2019/06/mindmeld-ai/amp/). Siehe das GitHub-Repository (https://github.com/cisco/mindmeld/blob/master/README.md).
Es tut mir leid, keine Tricks zu haben, da ich versuche, diesen Artikel zu berühren, aber ich möchte eine interaktive KI erstellen, indem ich die Blaupause ** Video Discovery ** verwende, die als Beispiel gemäß dem Playbook erstellt wurde. Überlegen. In Zukunft möchte ich dies als Referenz verwenden, um einen benutzerdefinierten Entwurf zu erstellen, der mir hilft, das Papier zu finden, das ich lesen möchte. Wir beginnen mit der Vorbereitung der Umgebung. Wenn Sie also ein japanisches Dokument haben, interessiert sind und es ausprobieren möchten, lesen Sie bitte diesen Artikel.
Als vorbereitende Vorbereitung für die Verwendung von MindMeld beginnen wir mit der Installation von MindMeld. Es gibt zwei Muster von Installationsoptionen:
sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.1
BuildVersion: 19B88
java -version
openjdk version "12" 2019-03-19
OpenJDK Runtime Environment (build 12+33)
OpenJDK 64-Bit Server VM (build 12+33, mixed mode, sharing)
#Homebrew-Update
brew update
#Virtualenv installieren
#Python verfügt über ein Modul, mit dem Sie eine virtuelle Umgebung erstellen können. Mit dieser virtuellen Umgebung können Sie eine virtuelle Umgebung erstellen.
#Sie können für jede virtuelle Umgebung unterschiedliche Versionen von Python verwenden.
sudo -H pip install --upgrade virtualenv
# Elasticsearch 6.7 gebrauchsfertig
#Aufgrund von Änderungen in der Java-Nutzungsrichtlinie benötigen MacOS-Benutzer eine Elasticsearch-Umgebung.
export JAVA_HOME=/path/to/java
curl https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.0.tar.gz -o elasticsearch-6.7.0.tar.gz
tar -zxvf elasticsearch-6.7.0.tar.gz
cd elasticsearch-6.7.0/bin
./elasticsearch
#Bestätigung des Starts von Elasticsearch
curl localhost:9200
{
"name" : "hoBpMt3",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "5G91TzSLTDO4WCFg9h5hhg",
"version" : {
"number" : "6.7.0",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "8453f77",
"build_date" : "2019-03-21T15:32:29.844721Z",
"build_snapshot" : false,
"lucene_version" : "7.7.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
#Vorbereiten der virtuellen Umgebung
mkdir my_mm_workspace4advent
cd my_mm_workspace4advent
virtualenv -p python3 .
source bin/activate
(deactivate)
#Installation und Bestätigung des MindMeld-Pakets
pip install mindmeld #Wenn hier eine Fehlermeldung angezeigt wird, installieren Sie das Paket, das den Fehler verursacht hat, erneut.
mindmeld #Wenn warnWarning angezeigt wird, können Sie es ignorieren.
Usage: mindmeld [OPTIONS] COMMAND [ARGS]...
Command line interface for MindMeld.
Options:
-V, --version Show the version and exit.
-v, --verbosity LVL Either CRITICAL, ERROR, WARNING,
INFO or DEBUG
-h, --help Show this message and exit.
Commands:
blueprint Sets up a blueprint application.
convert Converts a Rasa or DialogueFlow project to a...
load-kb Loads data into a question answerer index.
num-parse Starts or stops the local numerical parser...
#Start der numerischen Parser.
# (Hinweis)Wenn hier ein Fehler auftritt, können Sie nicht fortfahren. Stellen Sie sicher, dass Sie erfolgreich sind, bevor Sie fortfahren.
mindmeld num-parse --start
...
Numerical parser running, PID XXXXX
#Alternativ können Sie dies mit dem folgenden Befehl überprüfen.
mindmeld num-parse --start -p 9000
[Ergänzung] MindMeld verwendet einen rein funktionalen, auf Programmiersprachen basierenden numerischen Parser namens Haskell, um bestimmte numerische Darstellungen (wie Uhrzeit und Datum) in Benutzerabfragen anzuzeigen. Es wird erkannt. Wenn kein Port angegeben ist, wird er standardmäßig lokal auf Port 7151 gestartet.
mindmeld num-parse --start -Wenn Sie p 9000 ausführen, wird es an Port 9000 gestartet und lautet http://0.0.0.0:Quacksalber beim Zugriff auf 9000!Wird nur angezeigt.
### Beginn der Blaupause
Wenn Sie MindMeld noch nicht kennen, empfehlen wir Ihnen, zunächst die bereitgestellte Blueprint-Anwendung auszuprobieren.
Die folgenden vier Arten von Bauplänen werden als Muster erstellt.
1. Food Ordering (```food_ordering```)
2. Home Assistant (```home_assistaant```)
3. Videoerkennung (`` `video_discovery```) <-Blueprints, die in diesem Artikel behandelt werden
4. Kwik-E-Mart (```kwik_e_mart```)
Das Ziel von ** Video Discovery ** in diesem Artikel ist es, den Film oder die TV-Show, nach der ich suche, im Dialog mit MindMeld zu finden, wie im Bild unten gezeigt.
<img width="590" alt="スクリーンショット 2019-11-26 17.32.46.png " src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/214756/6ebc9852-a3fd-9dba-8cd3-bf0a14676c3f.png ">
```python
#Starten Sie Python
python
#Laden Sie die MindMeld Blueprint-Anwendung herunter und richten Sie sie ein
import mindmeld as mm
mm.configure_logs()
bp_name = 'video_discovery'
mm.blueprint(bp_name)
#Nach Abschluss des Setups wird das folgende Protokoll angezeigt.
# Created 'video_discovery' knowledge base at 'localhost'
# '/Users/XXX/my_mm_workspace4advent/video_discovery'
[Ergänzung]
bp_name = 'video_discovery'Überspringen Sie die Zeile und direkt mm.blueprint('video_discovery')Sie können es auch als tun.
Wenn der MindMeld-Projektordner (`` `video_discovery```) erstellt wird, wird ein Verzeichnis erstellt, wie in der Abbildung unten gezeigt.
<img width="554" alt="スクリーンショット 2019-11-26 17.50.59.png " src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/214756/7193a949-1cbc-f24b-ce05-6dcb2ff32d16.png ">
### Testlauf ①
```python
#Import und Einrichtung der QuestionAnswerer-Anwendung
from mindmeld.components.question_answerer import QuestionAnswerer
qa = QuestionAnswerer(app_path='video_discovery')
#Suchen Sie in den Knowledge Base-Einträgen nach "Movie Minions"
qa.get(index='videos', title='Minions')[0]
[Ergänzung] Das Ergebnis des Testlaufs ist wie folgt.
{'overview': 'Minions Stuart, Kevin and Bob are recruited by Scarlet Overkill, a super-villain who, alongside her inventor husband Herb, hatches a plot to take over the world.', 'imdb_id': 'tt2293640', 'directors': ['Kyle Balda', 'Pierre Coffin'], 'release_year': 2015, 'runtime': 91, 'doc_type': 'movie', 'countries': ['US'], 'title': 'Minions', 'cast': ['Sandra Bullock', 'Jon Hamm', 'Michael Keaton', 'Allison Janney', 'Steve Coogan', 'Jennifer Saunders', 'Geoffrey Rush', 'Steve Carell', 'Pierre Coffin', 'Katy Mixon', 'Michael Beattie', 'Hiroyuki Sanada', 'Dave Rosenbaum', 'Alex Dowding', 'Paul Thornley', 'Kyle Balda', 'Ava Acres'], 'img_url': 'http://image.tmdb.org/t/p/w185//q0R4crx2SehcEEQEkYObktdeFy.jpg', 'release_date': '2015-06-17', 'genres': ['Family', 'Animation', 'Adventure', 'Comedy'], 'vote_average': 6.4, 'popularity': 2.295467321653707, 'id': 'movie_211672', 'vote_count': 3660}
Diese ** Video Discovery ** -Anwendung verweist auf eine Website namens The Movie DB als Wissensdatenbank.
Trainieren Sie das NLP-System (`` `NaturalLanguageProcessor```-Klasse), indem Sie beschriftete Daten verwenden.
# (Möglichkeit)Protokollstufe ändern
import logging
logging.getLogger('mindmeld').setLevel(logging.INFO)
#Führen Sie ein Training für das NLP-Basissystem durch
from mindmeld import configure_logs; configure_logs()
from mindmeld.components.nlp import NaturalLanguageProcessor
nlp = NaturalLanguageProcessor(app_path='video_discovery')
nlp.build()
[Ergänzung] Durch Ändern der Protokollstufe können Sie den maschinellen Lernprozess wie folgt anzeigen.
Fitting domain classifier
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/unrelated/compliment/train.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/unrelated/general/train.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/unrelated/insult/train.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/browse/train_00.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/browse/train_01.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/browse/train_02.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/browse/train_03.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/browse/train_04.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/browse/train_05.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/browse/train_mturk_00.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/browse/train_range_00.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/exit/train.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/greet/train.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/help/train.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/start_over/train.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/unsupported/train_get_channel_00.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/unsupported/train_get_channel_01.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/unsupported/train_get_channel_02.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/unsupported/train_get_time_00.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/unsupported/train_get_time_01.txt
Loading raw queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/video_content/unsupported/train_get_time_02.txt
Loading queries from file /Users/yunambu/my_mm_workspace4advent/video_discovery/domains/unrelated/compliment/train.txt
Unable to connect to the system entity recognizer. Make sure it's running by typing 'mindmeld num-parse' at the command line.
Ein Fehler wurde ausgelöst. .. .. Wie mir gesagt wurde, scheint "Num-parse" richtig zu funktionieren, wenn ich mit "mindmeld num-parse" nachschaue.
mindmeld num-parse
...
Numerical parser running, PID 94958
Lassen Sie uns zuerst herausfinden, was diese `Systementität
ist. Dann gab es eine solche Beschreibung im Dokument.
""" Entities in MindMeld are categorized into two types:
System Entities Generic entities that are application-agnostic and are automatically detected by MindMeld. Examples include numbers, time expressions, email addresses, URLs and measured quantities like distance, volume, currency and temperature.
Custom Entities ...
System entities are generic application-agnostic entities that all MindMeld applications detect automatically. There is no need to train models to learn system entities; they just work. ... MindMeld does not assume that any of the system entities are needed in your app. It is the system entities that you annotate in your training data that MindMeld knows are needed. """
Kurz gesagt, es handelt sich um eine universelle Entität (numerischer Wert, Zeitdarstellung, E-Mail-Adresse, URL, Messung von Entfernung, Volumen, Währung, Temperatur usw.), die für alle von MindMeld bereitgestellten Anwendungen auf dieselbe Weise verwendet wird und mit dieser verbunden ist. Ich erhalte eine Fehlermeldung, dass dies nicht erledigt ist. Ich dachte, dass es ein Problem mit der `` `nlp.py``` geben könnte, die ich hier verwenden möchte, also habe ich mir den Quellcode wie folgt angesehen.
nlp.py
#Auszug nur aus den Teilen, die wahrscheinlich zutreffen
# system_entity_Erkennungsmodul(nlp.Elternmodul von py)Importieren Sie die SystemEntityRecongnizer-Klasse aus
from ..system_entity_recognizer import SystemEntityRecognizer
"""
Einzelheiten finden Sie unter System_entity_recongizer.Es ist in py auskommentiert.
Dieser SystemEntityRecognizer ist ein Singleton(Stellen Sie also sicher, dass es immer eine Instanz dieser Klasse gibt.)Es soll als verwendet werden.
Daher ist es so konzipiert, dass es während der Erstellung des NLP-Objekts nur einmal initialisiert wird.
Die Arbeit zum Initialisieren befindet sich in der folgenden Zeile.
"""
# initialize the system entity recognizer singleton
SystemEntityRecognizer.get_instance(app_path)
system_entity_recognizer.py
#Auszug nur aus den Teilen, die wahrscheinlich zutreffen
# nlp.Erstellen von Klassen für externe Parsing-Dienste, die von anderen Apps wie py verwendet werden.
class SystemEntityRecognizer:
"""SystemEntityRecognizer is the external parsing service used to extract
system entities. It is intended to be used as a singleton, so it's
initialized only once during NLP object construction.
TODO: Abstract this class into an interface and implement the duckling
service as one such service.
"""
_instance = None #Eine magische Sache, die bei der Verwendung von Singleton immer zum Vorschein kommt
def __init__(self, app_path=None):
#Spezielle Methode zum Initialisieren der Instanz, die beim Erstellen der Instanz aufgerufen wird__init__Definition von. App_Pfad hat Keine als Standardvariable
#Es heißt, dass dieser Konstruktor SystemEntityReconizer gewidmet ist. Beachten Sie, dass Sie bei der Verwendung unbedingt gettter verwenden müssen
"""Private constructor for SystemEntityRecognizer. Do not directly
construct the SystemEntityRecognizer object. Instead, use the
static get_instance method.
Args:
app_path (str): A application path
"""
if SystemEntityRecognizer._instance:
raise Exception("SystemEntityRecognizer is a singleton") #Verwenden Sie die Raise-Anweisung, um unter dieser Bedingung eine Ausnahme auszulösen
else: #Die folgende Entlein-API(Duckling =Open Source-Textanalyse in natürlicher Sprache)Es scheint, dass das Datum / die Uhrzeit und die gemessenen Werte aus den Informationen in der natürlichen Sprache unter Verwendung gebracht werden.
if not app_path:
# The service is turned on by default
self._use_duckling_api = True
else:
self._use_duckling_api = is_duckling_configured(app_path)
self.app_path = app_path
SystemEntityRecognizer._instance = self
@staticmethod #Wird als Klassenmethode verwendet
def get_instance(app_path=None):
""" Static access method.
Args:
app_path (str): A application path
Returns:
(SystemEntityRecognizer): A SystemEntityRecognizer instance
"""
if not SystemEntityRecognizer._instance:
SystemEntityRecognizer(app_path)
return SystemEntityRecognizer._instance
def get_response(self, data):
if not self._use_duckling_api:
return [], NO_RESPONSE_CODE
url = get_system_entity_url_config(app_path=self.app_path)
try: #Beschreiben Sie den Prozess, der auch dann erzwungen werden soll, wenn eine Ausnahme auftritt
response = requests.request('POST', url, data=data, timeout=1)
if response.status_code == requests.codes['ok']:
response_json = response.json()
# Remove the redundant 'values' key in the response['value'] dictionary
for i, entity_dict in enumerate(response_json):
if 'values' in entity_dict['value']:
del response_json[i]['value']['values']
return response_json, response.status_code
else:
raise SystemEntityError('System entity status code is not 200.')
except requests.ConnectionError: #Beschreiben Sie die Verarbeitung, wenn eine Ausnahme auftritt
sys.exit("Unable to connect to the system entity recognizer. Make sure it's "
"running by typing 'mindmeld num-parse' at the command line.") #Beenden Sie den Hauptprozess im laufenden Programm
except Exception as ex: # pylint: disable=broad-except
logger.error('Numerical Entity Recognizer Error: %s\nURL: %r\nData: %s', ex, url,
json.dumps(data))
sys.exit('\nThe system entity recognizer encountered the following ' +
'error:\n' + str(ex) + '\nURL: ' + url + '\nRaw data: ' + str(data) +
"\nPlease check your data and ensure Numerical parsing service is running. "
"Make sure it's running by typing "
"'mindmeld num-parse' at the command line.")
Soweit ich sehen kann, scheint es, dass die Verarbeitung zum Zeitpunkt der Ausnahme der letzten `try-Except``` -Anweisung von` `system_entity_recognizer.py``` funktioniert und schließlich`
Parsing Service``` nicht erreicht werden kann. Geben Sie also auf, was Sie mit "virtualenv" machen, und beginnen Sie erneut mit der Verwendung des Docker-Containers.
#Überprüfen der Docker-Version
docker version
Client: Docker Engine - Community
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:22:34 2019
OS/Arch: darwin/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.12)
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:29:19 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683
#Holen Sie sich das neueste Bild von MindMeld aus der Registrierung
docker pull mindmeldworkbench/dep:latest
#Neuer Container, 9200/7151/0 für jeden der Containerports 9300.0.0.9200 auf 0/7151/Binden Sie an Port 9300 und führen Sie ihn im Hintergrund aus.
docker run -p 0.0.0.0:9200:9200 -p 0.0.0.0:7151:7151 -p 0.0.0.0:9300:9300 mindmeldworkbench/dep -ti -d
#Vorbereiten und Starten einer virtuellen Umgebung
mkdir my_mm_workspace4advent2
cd my_mm_workspace4advent2
virtualenv -p python3 .
source bin/activate
#Installieren und starten Sie das MindMeld-Paket
pip install mindmeld
mindmeld
#Laden Sie MindMeld Blueprint herunter
mindmeld blueprint video_discovery #Sie können es auch über ein Terminal anstatt über die Python-Shell ausführen
#Import und Einrichtung der QuestionAnswerer-Anwendung
from mindmeld.components.question_answerer import QuestionAnswerer
qa = QuestionAnswerer(app_path='video_discovery')
#Suchen Sie in den Knowledge Base-Einträgen nach "Movie Minions"
qa.get(index='videos', title='Minions')[0]
[Ergänzung] Das Ergebnis des Testlaufs ist wie folgt.
{'overview': 'Minions Stuart, Kevin and Bob are recruited by Scarlet Overkill, a super-villain who, alongside her inventor husband Herb, hatches a plot to take over the world.', 'imdb_id': 'tt2293640', 'directors': ['Kyle Balda', 'Pierre Coffin'], 'release_year': 2015, 'runtime': 91, 'doc_type': 'movie', 'countries': ['US'], 'title': 'Minions', 'cast': ['Sandra Bullock', 'Jon Hamm', 'Michael Keaton', 'Allison Janney', 'Steve Coogan', 'Jennifer Saunders', 'Geoffrey Rush', 'Steve Carell', 'Pierre Coffin', 'Katy Mixon', 'Michael Beattie', 'Hiroyuki Sanada', 'Dave Rosenbaum', 'Alex Dowding', 'Paul Thornley', 'Kyle Balda', 'Ava Acres'], 'img_url': 'http://image.tmdb.org/t/p/w185//q0R4crx2SehcEEQEkYObktdeFy.jpg', 'release_date': '2015-06-17', 'genres': ['Family', 'Animation', 'Adventure', 'Comedy'], 'vote_average': 6.4, 'popularity': 2.295467321653707, 'id': 'movie_211672', 'vote_count': 3660}
# (Möglichkeit)Protokollstufe ändern
import logging
logging.getLogger('mindmeld').setLevel(logging.DEBUG) #Lassen Sie es uns in DEBUG ändern und das detaillierte Protokoll betrachten.
#Führen Sie ein Training für das NLP-Basissystem durch
from mindmeld import configure_logs; configure_logs()
from mindmeld.components.nlp import NaturalLanguageProcessor
nlp = NaturalLanguageProcessor(app_path='video_discovery')
nlp.build()
Fitting domain classifier
Loading raw queries from file video_discovery/domains/unrelated/compliment/train.txt
Loading raw queries from file video_discovery/domains/unrelated/general/train.txt
Loading raw queries from file video_discovery/domains/unrelated/insult/train.txt
Loading raw queries from file video_discovery/domains/video_content/browse/train_00.txt
Loading raw queries from file video_discovery/domains/video_content/browse/train_01.txt
Loading raw queries from file video_discovery/domains/video_content/browse/train_02.txt
Loading raw queries from file video_discovery/domains/video_content/browse/train_03.txt
Loading raw queries from file video_discovery/domains/video_content/browse/train_04.txt
Loading raw queries from file video_discovery/domains/video_content/browse/train_05.txt
Loading raw queries from file video_discovery/domains/video_content/browse/train_mturk_00.txt
Loading raw queries from file video_discovery/domains/video_content/browse/train_range_00.txt
Loading raw queries from file video_discovery/domains/video_content/exit/train.txt
Loading raw queries from file video_discovery/domains/video_content/greet/train.txt
Loading raw queries from file video_discovery/domains/video_content/help/train.txt
Loading raw queries from file video_discovery/domains/video_content/start_over/train.txt
Loading raw queries from file video_discovery/domains/video_content/unsupported/train_get_channel_00.txt
Loading raw queries from file video_discovery/domains/video_content/unsupported/train_get_channel_01.txt
Loading raw queries from file video_discovery/domains/video_content/unsupported/train_get_channel_02.txt
Loading raw queries from file video_discovery/domains/video_content/unsupported/train_get_time_00.txt
Loading raw queries from file video_discovery/domains/video_content/unsupported/train_get_time_01.txt
Loading raw queries from file video_discovery/domains/video_content/unsupported/train_get_time_02.txt
Loading queries from file video_discovery/domains/unrelated/compliment/train.txt
Loading queries from file video_discovery/domains/unrelated/general/train.txt
Loading queries from file video_discovery/domains/unrelated/insult/train.txt
Loading queries from file video_discovery/domains/video_content/browse/train_00.txt
Loading queries from file video_discovery/domains/video_content/browse/train_01.txt
Loading queries from file video_discovery/domains/video_content/browse/train_02.txt
Loading queries from file video_discovery/domains/video_content/browse/train_03.txt
Loading queries from file video_discovery/domains/video_content/browse/train_04.txt
Loading queries from file video_discovery/domains/video_content/browse/train_05.txt
Loading queries from file video_discovery/domains/video_content/browse/train_mturk_00.txt
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for "80's".
Unable to load query: Unable to resolve system entity of type 'sys_interval' for "1990's".
Unable to load query: Unable to resolve system entity of type 'sys_interval' for "1990's".
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1980s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for 'all time'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '70s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for "80's".
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1980s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for "90's".
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for 'all time'.
Unable to load query: Unable to resolve system entity of type 'sys_time' for 'the year'.
Unable to load query: Unable to resolve system entity of type 'sys_time' for 'this moment'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for "90's".
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '2010-2015'. Entities found for the following types ['sys_temperature', 'sys_amount-of-money', 'sys_phone-number']
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1980s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1980s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '2000s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for "90's".
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '2000 to now'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '2000s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for 'last year'. Entities found for the following types ['sys_time']
Unable to load query: Unable to resolve system entity of type 'sys_interval' for "40's".
Unable to load query: Unable to resolve system entity of type 'sys_interval' for 'last decade'.
Unable to load query: Unable to resolve system entity of type 'sys_time' for 'this summer'. Entities found for the following types ['sys_interval']
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1950s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '2000s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1960s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Loading queries from file video_discovery/domains/video_content/browse/train_range_00.txt
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90 s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '2000 s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1970s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1900s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1970s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80 s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1970 s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1970s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1990 to 1995'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80 s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '60s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90 s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for 'eighties'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '70s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1980s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for 'last year'. Entities found for the following types ['sys_time']
Unable to load query: Unable to resolve system entity of type 'sys_interval' for 'last year'. Entities found for the following types ['sys_time']
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80 s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1960s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for 'late 1990 s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for 'past year'. Entities found for the following types ['sys_time']
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80 s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '2000s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90 s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '60s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '2010s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1980s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90 s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '80s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '90s'.
Unable to load query: Unable to resolve system entity of type 'sys_interval' for '1950s'.
Loading queries from file video_discovery/domains/video_content/exit/train.txt
Loading queries from file video_discovery/domains/video_content/greet/train.txt
Loading queries from file video_discovery/domains/video_content/help/train.txt
Loading queries from file video_discovery/domains/video_content/start_over/train.txt
Loading queries from file video_discovery/domains/video_content/unsupported/train_get_channel_00.txt
Loading queries from file video_discovery/domains/video_content/unsupported/train_get_channel_01.txt
Loading queries from file video_discovery/domains/video_content/unsupported/train_get_channel_02.txt
Loading queries from file video_discovery/domains/video_content/unsupported/train_get_time_00.txt
Loading queries from file video_discovery/domains/video_content/unsupported/train_get_time_01.txt
Loading queries from file video_discovery/domains/video_content/unsupported/train_get_time_02.txt
Building gazetteer 'sort'
Loading entity data from 'video_discovery/entities/sort/gazetteer.txt'
52/52 entities in entity data file exceeded popularity cutoff and were added to the gazetteer
Loading synonyms from entity mapping
Added 49/49 synonyms from file into gazetteer
Building gazetteer 'director'
Loading entity data from 'video_discovery/entities/director/gazetteer.txt'
89750/89750 entities in entity data file exceeded popularity cutoff and were added to the gazetteer
Loading synonyms from entity mapping
Added 0/0 synonyms from file into gazetteer
Building gazetteer 'title'
Loading entity data from 'video_discovery/entities/title/gazetteer.txt'
276728/276728 entities in entity data file exceeded popularity cutoff and were added to the gazetteer
Loading synonyms from entity mapping
Added 0/0 synonyms from file into gazetteer
Building gazetteer 'cast'
Loading entity data from 'video_discovery/entities/cast/gazetteer.txt'
486719/486719 entities in entity data file exceeded popularity cutoff and were added to the gazetteer
Loading synonyms from entity mapping
Added 0/0 synonyms from file into gazetteer
Building gazetteer 'genre'
Loading entity data from 'video_discovery/entities/genre/gazetteer.txt'
101/101 entities in entity data file exceeded popularity cutoff and were added to the gazetteer
Loading synonyms from entity mapping
Added 70/70 synonyms from file into gazetteer
Building gazetteer 'type'
Loading entity data from 'video_discovery/entities/type/gazetteer.txt'
18/18 entities in entity data file exceeded popularity cutoff and were added to the gazetteer
Loading synonyms from entity mapping
Added 20/20 synonyms from file into gazetteer
Building gazetteer 'country'
Loading entity data from 'video_discovery/entities/country/gazetteer.txt'
477/477 entities in entity data file exceeded popularity cutoff and were added to the gazetteer
Loading synonyms from entity mapping
Added 243/243 synonyms from file into gazetteer
Fitting intent classifier: domain='video_content'
Selecting hyperparameters using k-fold cross-validation with 5 splits
Best accuracy: 98.12%, params: {'C': 10, 'class_weight': {0: 0.5805006811989102, 1: 3.431368821292776, 2: 0.9903185247275775, 3: 5.1444117647058825, 4: 2.906170886075949, 5: 0.6776020174232005}, 'fit_intercept': True}
Fitting entity recognizer: domain='video_content', intent='browse'
No entity_resolution model configuration set. Using default.
No entity_resolution model configuration set. Using default.
No entity_resolution model configuration set. Using default.
No entity_resolution model configuration set. Using default.
No entity_resolution model configuration set. Using default.
No entity_resolution model configuration set. Using default.
No entity_resolution model configuration set. Using default.
No entity_resolution model configuration set. Using default.
No entity_resolution model configuration set. Using default.
Fitting role classifier: domain='video_content', intent='browse', entity_type='type'
No role model configuration set. Using default.
Importing synonym data to synonym index 'synonym_type'
Creating index 'synonym_type'
100%|████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 23.57it/s]
Loaded 2 documents
Fitting role classifier: domain='video_content', intent='browse', entity_type='country'
No role model configuration set. Using default.
Importing synonym data to synonym index 'synonym_country'
Creating index 'synonym_country'
100%|███████████████████████████████████████████████████████████████████████████| 235/235 [00:00<00:00, 555.92it/s]
Loaded 235 documents
Fitting role classifier: domain='video_content', intent='browse', entity_type='sys_interval'
No role model configuration set. Using default.
Fitting role classifier: domain='video_content', intent='browse', entity_type='cast'
No role model configuration set. Using default.
Importing synonym data to synonym index 'synonym_cast'
Creating index 'synonym_cast'
0it [00:00, ?it/s]
Loaded 0 documents
Fitting role classifier: domain='video_content', intent='browse', entity_type='genre'
No role model configuration set. Using default.
Importing synonym data to synonym index 'synonym_genre'
Creating index 'synonym_genre'
100%|█████████████████████████████████████████████████████████████████████████████| 31/31 [00:00<00:00, 270.29it/s]
Loaded 31 documents
Fitting role classifier: domain='video_content', intent='browse', entity_type='sort'
No role model configuration set. Using default.
Importing synonym data to synonym index 'synonym_sort'
Creating index 'synonym_sort'
100%|████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 43.20it/s]
Loaded 4 documents
Fitting role classifier: domain='video_content', intent='browse', entity_type='sys_time'
No role model configuration set. Using default.
Fitting role classifier: domain='video_content', intent='browse', entity_type='director'
No role model configuration set. Using default.
Importing synonym data to synonym index 'synonym_director'
Creating index 'synonym_director'
0it [00:00, ?it/s]
Loaded 0 documents
Fitting role classifier: domain='video_content', intent='browse', entity_type='title'
No role model configuration set. Using default.
Importing synonym data to synonym index 'synonym_title'
Creating index 'synonym_title'
0it [00:00, ?it/s]
Loaded 0 documents
Fitting entity recognizer: domain='video_content', intent='greet'
There are no labels in this label set, so we don't fit the model.
Fitting entity recognizer: domain='video_content', intent='help'
There are no labels in this label set, so we don't fit the model.
Fitting entity recognizer: domain='video_content', intent='start_over'
There are no labels in this label set, so we don't fit the model.
Fitting entity recognizer: domain='video_content', intent='exit'
There are no labels in this label set, so we don't fit the model.
Fitting entity recognizer: domain='video_content', intent='unsupported'
There are no labels in this label set, so we don't fit the model.
Fitting intent classifier: domain='unrelated'
Selecting hyperparameters using k-fold cross-validation with 5 splits
Best accuracy: 70.87%, params: {'C': 1, 'class_weight': {0: 0.9618644067796609, 1: 1.009, 2: 1.0395604395604394}, 'fit_intercept': True}
Fitting entity recognizer: domain='unrelated', intent='insult'
There are no labels in this label set, so we don't fit the model.
Fitting entity recognizer: domain='unrelated', intent='general'
There are no labels in this label set, so we don't fit the model.
Fitting entity recognizer: domain='unrelated', intent='compliment'
There are no labels in this label set, so we don't fit the model.
Sie können den Fehler "Beste Genauigkeit: 70,87%, Parameter: {'C': 1, 'Klassengewicht': {0: 0,9618644067796609, 1: 1,009, 2: 1,0395604395604394}, 'fit_intercept': True}" vorerst vermeiden Ich habe das Ergebnis erhalten `.
Unable to load query: Unable to resolve system entity of type 'sys_interval'、Unable to load query: Unable to resolve system entity of type 'sys_time'Ich war besorgt, dass es ein Protokoll gibt, das dies sagt, aber ich werde es hinzufügen, sobald ich es verstehe, da die Ursache bis zum Veröffentlichungsdatum nicht untersucht werden konnte.
Zu diesem Zeitpunkt ist auch `` `Keine Entity_Resolution-Modellkonfiguration festgelegt. Mit Standard.```, und die Genauigkeit beträgt nur weniger als 70%. Im Testlauf ③ danach wird die Methode zur Merkmalsextraktion beschrieben. Wir werden die Genauigkeit durch Auswahl und Anpassung verbessern.
### Testlauf ③
```python
#Wirf eine Testabfrage gegen ein trainiertes NLP-System
nlp.process("Show me movies with Yo Oizumi")
{'text': 'Show me movies with Yo Oizumi', 'domain': 'video_content', 'intent': 'browse', 'entities': [{'text': 'movies', 'type': 'type', 'role': None, 'value': [{'cname': 'movie', 'score': 19.448803, 'top_synonym': 'movies'}, {'cname': 'tv-show', 'score': 1.684855, 'top_synonym': 'series'}], 'span': {'start': 8, 'end': 13}}, {'text': 'Yo Oizumi', 'type': 'cast', 'role': None, 'value': [], 'span': {'start': 20, 'end': 28}}]}
#Erstellen eines Intent Classifier. Verwenden Sie diese Option, um auf die Einstellungen für die Modell- und Feature-Extraktion zuzugreifen
>>> ic = nlp.domains['video_content'].intent_classifier
>>> ic.config.model_settings['classifier_type']
'logreg'
>>> ic.config.features
{'bag-of-words': {'lengths': [1, 2]}, 'edge-ngrams': {'lengths': [1, 2]}, 'in-gaz': {}, 'exact': {'scaling': 10}, 'gaz-freq': {}, 'freq': {'bins': 5}}
#Dieser Klassifikator passt()Durch Übergeben geeigneter Parameter mithilfe von Methoden können Sie verschiedene Lernalgorithmen, Funktionen, Hyperparameter, Einstellungen für die gegenseitige Überprüfung usw. ausprobieren.
#Zum Beispiel standardmäßig bag-of-Wörter werden in der Merkmalsextraktion verwendet, aber Tasche-of-N-Sie können auch Gramm hinzufügen und verwenden.
#Ich verwende hier einen Beispielentwurf, der bereits enthalten ist.
>>> ic.config.features['bag-of-words']['lengths'].append(3)
>>> ic.fit() # fit(learan_data, learn_label)Trainingsdaten und -ergebnisse können mit Methoden trainiert werden
Fitting intent classifier: domain='video_content'
Selecting hyperparameters using k-fold cross-validation with 5 splits
Best accuracy: 98.12%, params: {'C': 10, 'class_weight': {0: 0.8202145776566757, 1: 2.0420152091254753, 2: 0.9958507963118188, 3: 2.7761764705882355, 4: 1.8169303797468355, 5: 0.8618294360385144}, 'fit_intercept': True}
Wenn Sie alle Schritte bis zu diesem Punkt ausgeführt haben, testen Sie Ihre interaktive Anwendung mit der Klasse "Konversation".
from mindmeld.components.dialogue import Conversation
conv = Conversation(nlp=nlp, app_path='video_discovery')
res = conv.say("Show me movies with Yo Oizumi")
print(res[1])
{
"popularity": 1.6843605812038211,
"release_year": 2001,
"title": "Spirited Away",
"type": "movie"
}
{
"popularity": 1.331518694517026,
"release_year": 2004,
"title": "Howl's Moving Castle",
"type": "movie"
}
{
"popularity": 0.9276412700980977,
"release_year": 2014,
"title": "When Marnie Was There",
"type": "movie"
}
{
"popularity": 0.5483075183578056,
"release_year": 2002,
"title": "The Cat Returns",
"type": "movie"
}
{
"popularity": 0.48987671974559993,
"release_year": 2015,
"title": "I Am a Hero",
"type": "movie"
}
{
"popularity": 0.40345108131710566,
"release_year": 2015,
"title": "The Boy and the Beast",
"type": "movie"
}
{
"popularity": 0.21568218441881915,
"release_year": 2006,
"title": "Brave Story",
"type": "movie"
}
{
"popularity": 0.14845276320241113,
"release_year": 2015,
"title": "Kakekomi",
"type": "movie"
}
{
"popularity": 0.12538694143866852,
"release_year": 2009,
"title": "Professor Layton and the Eternal Diva",
"type": "movie"
}
{
"popularity": 0.0982032635261464,
"release_year": 2007,
"title": "Kitaro",
"type": "movie"
}
say()
Die Methode packt den Eingabetext in ein Benutzeranforderungsobjekt und übergibt ihn an den Mindmeld-Anwendungsmanager, um die Interaktion des Benutzers mit der Anwendung zu simulieren. Diese Methode gibt den Teil des Antworttextes aus, der vom Dialogmanager gesendet wird.
>>> conv.say('Hi, there!')
['Hi!', 'Talk to me to browse movies and TV shows.', '{\n "popularity": 4.904354681204688,\n "release_year": 2017,\n "title": "Wonder Woman",\n "type": "movie"\n}\n{\n "popularity": 4.743179401930947,\n "release_year": 2017,\n "title": "Beauty and the Beast",\n "type": "movie"\n}\n{\n "popularity": 4.390633761852561,\n "release_year": 2017,\n "title": "Transformers: The Last Knight",\n "type": "movie"\n}\n{\n "popularity": 4.316296603970634,\n "release_year": 2017,\n "title": "Logan",\n "type": "movie"\n}\n{\n "popularity": 4.088732678349925,\n "release_year": 2017,\n "title": "The Mummy",\n "type": "movie"\n}\n{\n "popularity": 3.9604223694356175,\n "release_year": 2017,\n "title": "Kong: Skull Island",\n "type": "movie"\n}\n{\n "popularity": 3.920513974901613,\n "release_year": 2005,\n "title": "Doctor Who",\n "type": "tv-show"\n}\n{\n "popularity": 3.8653508696521426,\n "release_year": 2011,\n "title": "Game of Thrones",\n "type": "tv-show"\n}\n{\n "popularity": 3.7942142869419615,\n "release_year": 2010,\n "title": "The Walking Dead",\n "type": "tv-show"\n}\n{\n "popularity": 3.575316921466775,\n "release_year": 2017,\n "title": "Pirates of the Caribbean: Dead Men Tell No Tales",\n "type": "movie"\n}', "Suggestions: 'Most popular', 'Most recent', 'Movies', 'TV Shows', 'Action', 'Dramas', 'Sci-Fi'"]
>>>
>>> conv.say('Show me Yo Oizumi movies')
['Ok. Here are some results:', '{\n "popularity": 1.6843605812038211,\n "release_year": 2001,\n "title": "Spirited Away",\n "type": "movie"\n}\n{\n "popularity": 1.331518694517026,\n "release_year": 2004,\n "title": "Howl\'s Moving Castle",\n "type": "movie"\n}\n{\n "popularity": 0.9276412700980977,\n "release_year": 2014,\n "title": "When Marnie Was There",\n "type": "movie"\n}\n{\n "popularity": 0.5483075183578056,\n "release_year": 2002,\n "title": "The Cat Returns",\n "type": "movie"\n}\n{\n "popularity": 0.48987671974559993,\n "release_year": 2015,\n "title": "I Am a Hero",\n "type": "movie"\n}\n{\n "popularity": 0.40345108131710566,\n "release_year": 2015,\n "title": "The Boy and the Beast",\n "type": "movie"\n}\n{\n "popularity": 0.21568218441881915,\n "release_year": 2006,\n "title": "Brave Story",\n "type": "movie"\n}\n{\n "popularity": 0.14845276320241113,\n "release_year": 2015,\n "title": "Kakekomi",\n "type": "movie"\n}\n{\n "popularity": 0.12538694143866852,\n "release_year": 2009,\n "title": "Professor Layton and the Eternal Diva",\n "type": "movie"\n}\n{\n "popularity": 0.0982032635261464,\n "release_year": 2007,\n "title": "Kitaro",\n "type": "movie"\n}']
>>>
>>> conv.say('from 2015')
['Perfect. Here are some movies with Yo Oizumi:', '{\n "popularity": 0.48987671974559993,\n "release_year": 2015,\n "title": "I Am a Hero",\n "type": "movie"\n}\n{\n "popularity": 0.40345108131710566,\n "release_year": 2015,\n "title": "The Boy and the Beast",\n "type": "movie"\n}\n{\n "popularity": 0.14845276320241113,\n "release_year": 2015,\n "title": "Kakekomi",\n "type": "movie"\n}']
>>>
>>> conv.say('Thank you')
['See you later.']
>>>
>>> conv.say('do you have comedy movies?')
['Perfect. Here are some results:', '{\n "popularity": 3.575316921466775,\n "release_year": 2017,\n "title": "Pirates of the Caribbean: Dead Men Tell No Tales",\n "type": "movie"\n}\n{\n "popularity": 3.16142885645921,\n "release_year": 2017,\n "title": "Guardians of the Galaxy Vol. 2",\n "type": "movie"\n}\n{\n "popularity": 2.864445217663442,\n "release_year": 2017,\n "title": "Despicable Me 3",\n "type": "movie"\n}\n{\n "popularity": 2.8304034588472593,\n "release_year": 2017,\n "title": "Cars 3",\n "type": "movie"\n}\n{\n "popularity": 2.824917558393832,\n "release_year": 2017,\n "title": "Baywatch",\n "type": "movie"\n}\n{\n "popularity": 2.7538905585490667,\n "release_year": 2016,\n "title": "Deadpool",\n "type": "movie"\n}\n{\n "popularity": 2.6281775734086983,\n "release_year": 2016,\n "title": "Tomorrow Everything Starts",\n "type": "movie"\n}\n{\n "popularity": 2.561422298541789,\n "release_year": 2017,\n "title": "The Lego Batman Movie",\n "type": "movie"\n}\n{\n "popularity": 2.4652902501503737,\n "release_year": 2000,\n "title": "DragonHeart: A New Beginning",\n "type": "movie"\n}\n{\n "popularity": 2.4633532858463862,\n "release_year": 2017,\n "title": "Smurfs: The Lost Village",\n "type": "movie"\n}']
>>>
>>> conv.say('show me the ones with Yo Oizumi')
['Ok. Here are some comedy movies:', '{\n "popularity": 0.14845276320241113,\n "release_year": 2015,\n "title": "Kakekomi",\n "type": "movie"\n}\n{\n "popularity": 0.08592812381604169,\n "release_year": 2013,\n "title": "Detective in the Bar",\n "type": "movie"\n}\n{\n "popularity": 0.058488695289761736,\n "release_year": 2013,\n "title": "The Kiyosu Conference",\n "type": "movie"\n}\n{\n "popularity": 0.015350574738277112,\n "release_year": 2016,\n "title": "Gold Medal Man",\n "type": "movie"\n}\n{\n "popularity": 0.015203833742272778,\n "release_year": 2011,\n "title": "Drucker in the Dug-Out",\n "type": "movie"\n}\n{\n "popularity": 0.01330410659551587,\n "release_year": 2012,\n "title": "Bread of Happiness",\n "type": "movie"\n}\n{\n "popularity": 0.011187189390564376,\n "release_year": 2006,\n "title": "Sugar & Spice: F\\u00fbmi zekka",\n "type": "movie"\n}\n{\n "popularity": 0.006566393969770445,\n "release_year": 2014,\n "title": "A Drop of the Grapevine",\n "type": "movie"\n}\n{\n "popularity": 0.0005218638053935734,\n "release_year": 2006,\n "title": "Simsons",\n "type": "movie"\n}']
>>>
>>> conv.say('Released in 2012')
['Done. Here are some comedy movies starring Yo Oizumi:', '{\n "popularity": 0.01330410659551587,\n "release_year": 2012,\n "title": "Bread of Happiness",\n "type": "movie"\n}']
>>> conv.say('Thank you')
['Bye!']
So konnte ich vorerst alle Grundlagen ausprobieren. Ich denke, das Gute an MindMeld ist, dass es angepasst werden kann. Daher möchte ich in Zukunft versuchen, benutzerdefinierte Apps (`` `Article_Discovery``` Blueprint), japanische Lokalisierung, Chat-Bot-Integration usw. zu erstellen.
Die auf dieser Website geäußerten Meinungen und die entsprechenden Kommentare sind die persönlichen Meinungen des Posters und nicht die Meinungen von Cisco. Der Inhalt dieser Website dient nur zu Informationszwecken und darf nicht von Cisco oder einer anderen Partei unterstützt oder zum Ausdruck gebracht werden. Durch das Posten auf dieser Website übernimmt jeder Benutzer die volle Verantwortung für den Inhalt aller Informationen, die durch Posten, Verknüpfen oder andere Methoden hochgeladen werden, und schließt Cisco von jeglicher Verantwortung für die Nutzung dieser Website aus. Genau.
Recommended Posts