405 строки
29 KiB
Plaintext
405 строки
29 KiB
Plaintext
{
|
||
"cells": [
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# Deploy to ACI"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 1,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"name": "stderr",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"C:\\Users\\makayser\\AppData\\Roaming\\Python\\Python36\\site-packages\\requests\\__init__.py:91: RequestsDependencyWarning: urllib3 (1.25.7) or chardet (3.0.4) doesn't match a supported version!\n",
|
||
" RequestsDependencyWarning)\n",
|
||
"Failure while loading azureml_run_type_providers. Failed to load entrypoint hyperdrive = azureml.train.hyperdrive:HyperDriveRun._from_run_dto with exception (urllib3 1.25.7 (c:\\users\\makayser\\appdata\\local\\continuum\\anaconda3\\envs\\nlp\\lib\\site-packages), Requirement.parse('urllib3<1.25,>=1.21.1'), {'requests'}).\n",
|
||
"Failure while loading azureml_run_type_providers. Failed to load entrypoint azureml.PipelineRun = azureml.pipeline.core.run:PipelineRun._from_dto with exception (urllib3 1.25.7 (c:\\users\\makayser\\appdata\\local\\continuum\\anaconda3\\envs\\nlp\\lib\\site-packages), Requirement.parse('urllib3<1.25,>=1.21.1'), {'requests'}).\n",
|
||
"Failure while loading azureml_run_type_providers. Failed to load entrypoint azureml.ReusedStepRun = azureml.pipeline.core.run:StepRun._from_reused_dto with exception (urllib3 1.25.7 (c:\\users\\makayser\\appdata\\local\\continuum\\anaconda3\\envs\\nlp\\lib\\site-packages), Requirement.parse('urllib3<1.25,>=1.21.1'), {'requests'}).\n",
|
||
"Failure while loading azureml_run_type_providers. Failed to load entrypoint azureml.StepRun = azureml.pipeline.core.run:StepRun._from_dto with exception (urllib3 1.25.7 (c:\\users\\makayser\\appdata\\local\\continuum\\anaconda3\\envs\\nlp\\lib\\site-packages), Requirement.parse('urllib3<1.25,>=1.21.1'), {'requests'}).\n",
|
||
"Failure while loading azureml_run_type_providers. Failed to load entrypoint azureml.scriptrun = azureml.core.script_run:ScriptRun._from_run_dto with exception (urllib3 1.25.7 (c:\\users\\makayser\\appdata\\local\\continuum\\anaconda3\\envs\\nlp\\lib\\site-packages), Requirement.parse('urllib3<1.25,>=1.21.1'), {'requests'}).\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"import os\n",
|
||
"import json\n",
|
||
"\n",
|
||
"# from azureml.core.authentication import InteractiveLoginAuthentication\n",
|
||
"from azureml.core import Workspace\n",
|
||
"from azureml.core import Model\n",
|
||
"from azureml.core.resource_configuration import ResourceConfiguration\n",
|
||
"from azureml.core.webservice import Webservice, AciWebservice\n",
|
||
"from azureml.core import Environment\n",
|
||
"from azureml.core.conda_dependencies import CondaDependencies\n",
|
||
"from azureml.core import Webservice\n",
|
||
"from azureml.core.webservice import AciWebservice\n",
|
||
"from azureml.core.model import InferenceConfig\n",
|
||
"from azureml.exceptions import WebserviceException"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"## One-time auth"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 2,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"# interactive_auth = InteractiveLoginAuthentication(tenant_id=\"72f988bf-86f1-41af-91ab-2d7cd011db47\")\n",
|
||
"\n",
|
||
"# ws = Workspace.get(name='nlp-ml', \n",
|
||
"# subscription_id='50324bce-875f-4a7b-9d3c-0e33679f5d72', \n",
|
||
"# resource_group='nlp',\n",
|
||
"# auth=interactive_auth)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"## Parameters"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 3,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"language = 'de'\n",
|
||
"env = 'dev'\n",
|
||
"\n",
|
||
"#NOTE:\n",
|
||
"# Change language setting in custom.py before deployment!"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 4,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"nlp-ml\n",
|
||
"nlp\n",
|
||
"westeurope\n",
|
||
"50324bce-875f-4a7b-9d3c-0e33679f5d72\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"ws = Workspace.from_config()\n",
|
||
"print(ws.name, ws.resource_group, ws.location, ws.subscription_id, sep='\\n')"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"## Upload Model Assets"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 5,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"Registering model nlp_de_dev\n",
|
||
"Name: nlp_de_dev\n",
|
||
"Version: 3\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"model = Model.register(workspace=ws,\n",
|
||
" model_name=f'nlp_{language}_{env}', # Name of the registered model in your workspace.\n",
|
||
" model_path=f'../assets/assets_{language}.zip', # Local file to upload and register as a model.\n",
|
||
" resource_configuration=ResourceConfiguration(cpu=2, memory_in_gb=2),\n",
|
||
" description='NLP test version',\n",
|
||
" tags={'models': 'classification, ner, qa', 'version': '0.1',\n",
|
||
" 'language': language, 'environment': env})\n",
|
||
"\n",
|
||
"print('Name:', model.name)\n",
|
||
"print('Version:', model.version)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"## Configure Compute"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 6,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"aci_config = AciWebservice.deploy_configuration(cpu_cores=4, memory_gb=4) #, auth_enabled=True)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 7,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"environment = Environment('farmenv')\n",
|
||
"environment.python.conda_dependencies = CondaDependencies.create(pip_packages=[\n",
|
||
" 'azureml-defaults',\n",
|
||
" 'spacy',\n",
|
||
" 'transformers',\n",
|
||
" 'farm',\n",
|
||
" 'numpy',\n",
|
||
" 'azure-storage-blob'\n",
|
||
" ],\n",
|
||
" conda_packages=[\n",
|
||
" 'pytorch',\n",
|
||
" 'torchvision',\n",
|
||
" 'gensim',\n",
|
||
" 'numpy',\n",
|
||
" 'pandas'\n",
|
||
" ])"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 8,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"os.chdir('../code')"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"## Deploy"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 9,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"Running.....................\n",
|
||
"Succeeded\n",
|
||
"ACI service creation operation finished, operation \"Succeeded\"\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"service_name = f'nlp-{language}-{env}'\n",
|
||
"\n",
|
||
"aci_config = AciWebservice.deploy_configuration(cpu_cores=3, memory_gb=3) #, auth_enabled=True)\n",
|
||
"\n",
|
||
"inference_config = InferenceConfig(entry_script='infer.py',\n",
|
||
" source_directory='.',\n",
|
||
" environment=environment)\n",
|
||
"\n",
|
||
"# Remove any existing service under the same name.\n",
|
||
"try:\n",
|
||
"# Webservice(ws, service_name).delete()\n",
|
||
" # Retrieve existing service.\n",
|
||
" service = Webservice(name=service_name, workspace=ws)\n",
|
||
" # Update to new model(s).\n",
|
||
" service.update(models=[model], inference_config=inference_config)\n",
|
||
"except WebserviceException:\n",
|
||
" service = Model.deploy(ws, service_name, [model], inference_config, deployment_config=aci_config)\n",
|
||
"service.wait_for_deployment(show_output=True)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 10,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"<bound method Webservice.get_keys of AciWebservice(workspace=Workspace.create(name='nlp-ml', subscription_id='50324bce-875f-4a7b-9d3c-0e33679f5d72', resource_group='nlp'), name=nlp-de-dev, image_id=None, compute_type=None, state=ACI, scoring_uri=Healthy, tags=http://57012932-730f-429e-9488-ffd07e5e62e7.westeurope.azurecontainer.io/score, properties={})>"
|
||
]
|
||
},
|
||
"execution_count": 10,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"service.get_keys"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 11,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"'/bin/bash: /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/libtinfo.so.5: no version information available (required by /bin/bash)\\n/bin/bash: /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/libtinfo.so.5: no version information available (required by /bin/bash)\\n/bin/bash: /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/libtinfo.so.5: no version information available (required by /bin/bash)\\n/bin/bash: /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/libtinfo.so.5: no version information available (required by /bin/bash)\\nbash: /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/libtinfo.so.5: no version information available (required by bash)\\n2019-12-28T13:22:53,672867654+00:00 - gunicorn/run \\n2019-12-28T13:22:53,674547169+00:00 - rsyslog/run \\n2019-12-28T13:22:53,674589769+00:00 - iot-server/run \\n2019-12-28T13:22:53,691757325+00:00 - nginx/run \\n/usr/sbin/nginx: /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/libcrypto.so.1.0.0: no version information available (required by /usr/sbin/nginx)\\n/usr/sbin/nginx: /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/libcrypto.so.1.0.0: no version information available (required by /usr/sbin/nginx)\\n/usr/sbin/nginx: /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/libssl.so.1.0.0: no version information available (required by /usr/sbin/nginx)\\n/usr/sbin/nginx: /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/libssl.so.1.0.0: no version information available (required by /usr/sbin/nginx)\\n/usr/sbin/nginx: /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/libssl.so.1.0.0: no version information available (required by /usr/sbin/nginx)\\nEdgeHubConnectionString and IOTEDGE_IOTHUBHOSTNAME are not set. Exiting...\\n/bin/bash: /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/libtinfo.so.5: no version information available (required by /bin/bash)\\n2019-12-28T13:22:53,751539566+00:00 - iot-server/finish 1 0\\n2019-12-28T13:22:53,753002079+00:00 - Exit code 1 is normal. Not restarting iot-server.\\nStarting gunicorn 19.9.0\\nListening at: http://127.0.0.1:31311 (11)\\nUsing worker: sync\\nworker timeout is set to 300\\nBooting worker with pid: 40\\nInitialized PySpark session.\\nPyTorch version 1.3.1 available.\\n[ERROR] Could not find correct config.ini.\\n[ERROR] Could not find correct config.ini.\\nInitializing logger\\nStarting up app insights client\\nStarting up request id generator\\nStarting up app insight hooks\\nInvoking user\\'s init function\\n[INFO] Unpacked model assets.\\ndevice: cpu n_gpu: 0, distributed training: False, 16-bits training: False\\nloading configuration file /var/azureml-app/azureml-models/nlp_de_dev/3/bert-lde-t1/language_model_config.json\\nModel config {\\n \"attention_probs_dropout_prob\": 0.1,\\n \"finetuning_task\": null,\\n \"hidden_act\": \"gelu\",\\n \"hidden_dropout_prob\": 0.1,\\n \"hidden_size\": 768,\\n \"id2label\": {\\n \"0\": \"LABEL_0\",\\n \"1\": \"LABEL_1\"\\n },\\n \"initializer_range\": 0.02,\\n \"intermediate_size\": 3072,\\n \"is_decoder\": false,\\n \"label2id\": {\\n \"LABEL_0\": 0,\\n \"LABEL_1\": 1\\n },\\n \"language\": \"german\",\\n \"layer_norm_eps\": 1e-12,\\n \"max_position_embeddings\": 512,\\n \"name\": \"Bert\",\\n \"num_attention_heads\": 12,\\n \"num_hidden_layers\": 12,\\n \"num_labels\": 2,\\n \"output_attentions\": false,\\n \"output_hidden_states\": false,\\n \"output_past\": true,\\n \"pruned_heads\": {},\\n \"torchscript\": false,\\n \"type_vocab_size\": 2,\\n \"use_bfloat16\": false,\\n \"vocab_size\": 30000\\n}\\n\\nloading weights file /var/azureml-app/azureml-models/nlp_de_dev/3/bert-lde-t1/language_model.bin\\nFound files for loading 1 prediction heads\\nUsing class weights for task \\'text_classification\\': [7.540384615384616, 4.6129411764705885, 25.296774193548387, 0.4453151618398637, 1.2408227848101265, 0.5761939750183689, 0.25779092702169626, 2.6493243243243243, 15.080769230769231, 1.9954198473282443]\\nLoading prediction head from /var/azureml-app/azureml-models/nlp_de_dev/3/bert-lde-t1/prediction_head_0.bin\\nModel name \\'/var/azureml-app/azureml-models/nlp_de_dev/3/bert-lde-t1\\' not found in model shortcut name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncased, bert-base-multilingual-cased, bert-base-chinese, bert-base-german-cased, bert-large-uncased-whole-word-masking, bert-large-cased-whole-word-masking, bert-large-uncased-whole-word-masking-finetuned-squad, bert-large-cased-whole-word-masking-finetuned-squad, bert-base-cased-finetuned-mrpc, bert-base-german-dbmdz-cased, bert-base-german-dbmdz-uncased, bert-base-finnish-cased-v1, bert-base-finnish-uncased-v1). Assuming \\'/var/azureml-app/azureml-models/nlp_de_dev/3/bert-lde-t1\\' is a path or url to a directory containing tokenizer files.\\nloading file /var/azureml-app/azureml-models/nlp_de_dev/3/bert-lde-t1/vocab.txt\\nloading file /var/azureml-app/azureml-models/nlp_de_dev/3/bert-lde-t1/added_tokens.json\\nloading file /var/azureml-app/azureml-models/nlp_de_dev/3/bert-lde-t1/special_tokens_map.json\\nloading file /var/azureml-app/azureml-models/nlp_de_dev/3/bert-lde-t1/tokenizer_config.json\\nInitialized processor without tasks. Supply `metric` and `label_list` to the constructor for using the default task or add a custom task later via processor.add_task()\\ndevice: cpu n_gpu: 0, distributed training: False, 16-bits training: False\\n[INFO] Download spacy language model for de\\nCollecting de_core_news_sm==2.2.5\\n Downloading https://github.com/explosion/spacy-models/releases/download/de_core_news_sm-2.2.5/de_core_news_sm-2.2.5.tar.gz (14.9MB)\\nRequirement already satisfied: spacy>=2.2.2 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from de_core_news_sm==2.2.5) (2.2.3)\\nRequirement already satisfied: thinc<7.4.0,>=7.3.0 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from spacy>=2.2.2->de_core_news_sm==2.2.5) (7.3.1)\\nRequirement already satisfied: srsly<1.1.0,>=0.1.0 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from spacy>=2.2.2->de_core_news_sm==2.2.5) (0.2.0)\\nRequirement already satisfied: numpy>=1.15.0 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from spacy>=2.2.2->de_core_news_sm==2.2.5) (1.17.3)\\nRequirement already satisfied: blis<0.5.0,>=0.4.0 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from spacy>=2.2.2->de_core_news_sm==2.2.5) (0.4.1)\\nRequirement already satisfied: plac<1.2.0,>=0.9.6 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from spacy>=2.2.2->de_core_news_sm==2.2.5) (1.1.3)\\nRequirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from spacy>=2.2.2->de_core_news_sm==2.2.5) (1.0.2)\\nRequirement already satisfied: setuptools in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from spacy>=2.2.2->de_core_news_sm==2.2.5) (42.0.2.post20191201)\\nRequirement already satisfied: requests<3.0.0,>=2.13.0 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from spacy>=2.2.2->de_core_news_sm==2.2.5) (2.22.0)\\nRequirement already satisfied: catalogue<1.1.0,>=0.0.7 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from spacy>=2.2.2->de_core_news_sm==2.2.5) (0.0.8)\\nRequirement already satisfied: wasabi<1.1.0,>=0.4.0 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from spacy>=2.2.2->de_core_news_sm==2.2.5) (0.4.2)\\nRequirement already satisfied: cymem<2.1.0,>=2.0.2 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from spacy>=2.2.2->de_core_news_sm==2.2.5) (2.0.3)\\nRequirement already satisfied: preshed<3.1.0,>=3.0.2 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from spacy>=2.2.2->de_core_news_sm==2.2.5) (3.0.2)\\nRequirement already satisfied: tqdm<5.0.0,>=4.10.0 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from thinc<7.4.0,>=7.3.0->spacy>=2.2.2->de_core_news_sm==2.2.5) (4.41.0)\\nRequirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from requests<3.0.0,>=2.13.0->spacy>=2.2.2->de_core_news_sm==2.2.5) (1.25.7)\\nRequirement already satisfied: certifi>=2017.4.17 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from requests<3.0.0,>=2.13.0->spacy>=2.2.2->de_core_news_sm==2.2.5) (2019.11.28)\\nRequirement already satisfied: idna<2.9,>=2.5 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from requests<3.0.0,>=2.13.0->spacy>=2.2.2->de_core_news_sm==2.2.5) (2.8)\\nRequirement already satisfied: chardet<3.1.0,>=3.0.2 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from requests<3.0.0,>=2.13.0->spacy>=2.2.2->de_core_news_sm==2.2.5) (3.0.4)\\nRequirement already satisfied: importlib-metadata>=0.20; python_version < \"3.8\" in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from catalogue<1.1.0,>=0.0.7->spacy>=2.2.2->de_core_news_sm==2.2.5) (1.3.0)\\nRequirement already satisfied: zipp>=0.5 in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from importlib-metadata>=0.20; python_version < \"3.8\"->catalogue<1.1.0,>=0.0.7->spacy>=2.2.2->de_core_news_sm==2.2.5) (0.6.0)\\nRequirement already satisfied: more-itertools in /azureml-envs/azureml_8de03559e2dcd264a4f9a15817343eb6/lib/python3.6/site-packages (from zipp>=0.5->importlib-metadata>=0.20; python_version < \"3.8\"->catalogue<1.1.0,>=0.0.7->spacy>=2.2.2->de_core_news_sm==2.2.5) (8.0.2)\\nBuilding wheels for collected packages: de-core-news-sm\\n Building wheel for de-core-news-sm (setup.py): started\\n Building wheel for de-core-news-sm (setup.py): finished with status \\'done\\'\\n Created wheel for de-core-news-sm: filename=de_core_news_sm-2.2.5-cp36-none-any.whl size=14907056 sha256=048db126f40d82c24d29763fd0cacbb318365fed6f6cbc833b367280c79f1fce\\n Stored in directory: /tmp/pip-ephem-wheel-cache-qwgzerbd/wheels/ba/3f/ed/d4aa8e45e7191b7f32db4bfad565e7da1edbf05c916ca7a1ca\\nSuccessfully built de-core-news-sm\\nInstalling collected packages: de-core-news-sm\\nSuccessfully installed de-core-news-sm-2.2.5\\n\\x1b[38;5;2m✔ Download and installation successful\\x1b[0m\\nYou can now load the model via spacy.load(\\'de_core_news_sm\\')\\n[INFO] Stopwords list lenght: 8320\\n[INFO] Loaded model and prepare steps for task 1.\\n[INFO] Stopwords list lenght: 8320\\n[INFO] Loaded model and prepare steps for task 3.\\n[INFO] Stopwords list lenght: 8320\\n[INFO] Stopwords list lenght: 8320\\n[INFO] Loaded model and prepare steps for task 4.\\nUsers\\'s init has completed successfully\\nScoring timeout is found from os.environ: 60000 ms\\n'"
|
||
]
|
||
},
|
||
"execution_count": 11,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"service.get_logs()"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"## Test Service"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 12,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"[{'task': 1,\n",
|
||
" 'params': {'label': 'subcat',\n",
|
||
" 'type': 'classification',\n",
|
||
" 'language': 'de',\n",
|
||
" 'prepare': None},\n",
|
||
" 'result': 'protect'},\n",
|
||
" {'task': 3,\n",
|
||
" 'params': {'type': 'ner', 'language': 'de', 'prepare': None},\n",
|
||
" 'result': [{'value': 'Windows Vista',\n",
|
||
" 'start': 5,\n",
|
||
" 'end': 18,\n",
|
||
" 'label': 'MISC'},\n",
|
||
" {'value': 'mir eh', 'start': 93, 'end': 99, 'label': 'ORG'},\n",
|
||
" {'value': 'Bill Gates', 'start': 149, 'end': 159, 'label': 'PER'},\n",
|
||
" {'value': 'Windows Vista', 'start': 1, 'end': 3, 'label': 'Product'}]},\n",
|
||
" {'task': 4,\n",
|
||
" 'params': {'type': 'qa', 'language': 'de', 'prepare': None},\n",
|
||
" 'result': [{'question_clean': 'installation microsoft security essential vista mehrmals versuchen security essential installieren schluß meldung fehler installieren handeln fehler code per online hilfe microsoft trotzen bemühung fehler beheben notebook vista geschenen problem security essential pc windows xp installieren erfahrung helfen',\n",
|
||
" 'answer_text_clean': 'Bitte etwas mehr Informationen.hast du dritte Sicherheits - Software installiert?Welche Sicherheitslösung hattest du vorher?Bitte versuche zuerst die Standardloesungen welche als Sticky markiert sind.Gruß Richard',\n",
|
||
" 'appliesTo': 'protect,Microsoft Security Essentials,Installation/Deinstallation und Upgrade',\n",
|
||
" 'score': '14.42'},\n",
|
||
" {'question_clean': 'app store laden fehler per antje betriebssystem windows 8 1 benutzen firefox remaige pc repair instaliert hoffen vergessen frage komplizieren abend app store laden erscheinen per app kaufen remaigeprogramm liegen 3 helfen laptop sowas beheben kosten weiss halbe stunde microsoft telefonieren geld weiterhelfen traurig laptop kaufen herr microsoft app s store installieren schaden',\n",
|
||
" 'answer_text_clean': 'Reimage ist Schadsoftware. Es zeigt dir Fehler an, die es gar nicht gibt. Entferne es, und mach in Zukunft bitte einen großen Bogen um alles, was dir seltsame Versprechungen macht und dann auch noch Geld dafür will. Du brauchst keine Tools um \"reparieren\", \"cleanen\" oder \"tunen\" Windows.Womöglich hat das Programm auch den Fehler mit dem Store verursacht. Starte die Systemwiederherstellung Windows und setze auf einen Wiederherstellungspunkt zurück, an dem der Store noch lief. Eventuell hast du auch noch andere Schadsoftware auf dem PC. Scanne den PC mit dem adwCleaner.http://www.heise.de/download/adwcleaner-1191313.html',\n",
|
||
" 'appliesTo': 'protect,Weitere,Suchen, Erkennen und Entfernen von Bedrohungen,Windows 8.1',\n",
|
||
" 'score': '13.16'},\n",
|
||
" {'question_clean': 'windowsdefender sicherheit laptops leute verzweifeln laptop kaufen problem schadhaft virus z b webssearcher mittlerweile spy hunter bekommen programm ständig nachricht zwecks kauf einstellungen bildschirm knallen geld firewalls leisten gedenken geld laptop ausgeben extra windows kaufen verlassen grundmaterial pc schützen kennen einstellung verändern zukunft problem wenden frage windows betriebssystem vorhanden programm firewall sch',\n",
|
||
" 'answer_text_clean': 'Torsten,mit Windows 8 hast du bereits eine Firewall und einen Virenschutz (Windows Defender) integriert, diese sind auch aktiv und arbeiten im Hintergrund. Du musst also nichts separat konfigurieren oder aktivieren.Die dir genannten Sachen hast du dir vermutlich über andere Software (meiste Freeware-Programme) mit installiert.Bei der Installation Programmen musst du darauf achten, dass auch wirklich nur das gewünschte Programm installiert wird. In der Regel hast du bei einer Programm-Installation die Möglichkeit, eine \"benutzerdefinierte Installation\" durchzuführen. Bei der benutzerdefinierten Installation kannst du dann selbst entscheiden, was alles installiert werden soll. Es sollte natürlich alles, bis auf das Hauptprogramm,abgewählt werden.Da sich vermutlich bereits unerwünschte Programme auf deinem Computer befinden, solltest du deinen Computer mal mit dem AdwCleaner überprüfen.http://www.heise.de/download/adwcleaner-1191313.htmlGrußSilvio',\n",
|
||
" 'appliesTo': 'protect,Weitere,Suchen, Erkennen und Entfernen von Bedrohungen,Windows 8',\n",
|
||
" 'score': '11.72'}]}]"
|
||
]
|
||
},
|
||
"execution_count": 12,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"service.run(json.dumps([{\"body\": \"Mein Windows Vista rechner will nicht mehr - ich kriege dauernd fehler meldungen. Ich wollte mir eh einen neuen kaufen, aber ich hab kein Geld. Kann Bill Gates mir helfen?\"}]))"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 13,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"[{'task': 1,\n",
|
||
" 'params': {'label': 'subcat',\n",
|
||
" 'type': 'classification',\n",
|
||
" 'language': 'de',\n",
|
||
" 'prepare': None},\n",
|
||
" 'result': 'xbox'},\n",
|
||
" {'task': 3,\n",
|
||
" 'params': {'type': 'ner', 'language': 'de', 'prepare': None},\n",
|
||
" 'result': [{'value': \"My pc won't\",\n",
|
||
" 'start': 0,\n",
|
||
" 'end': 11,\n",
|
||
" 'label': 'MISC'}]},\n",
|
||
" {'task': 4,\n",
|
||
" 'params': {'type': 'qa', 'language': 'de', 'prepare': None},\n",
|
||
" 'result': [{'question_clean': 'halo master chief collection won t launch i wanted to play halo on pc but when i installed it it won t even launch i would click play the xbox app would minimize like normal i waited for couple minutes and it didn t launch then i reinstalled it and i waited like pns minutes and it wouldn t open',\n",
|
||
" 'answer_text_clean': 'There has been many people with the same problem. Try starting the game from the start menu instead of the Xbox App. It will be stuck on the splash screen for a few minutes but wait it out and the game should launch fine then. https://news.softpedia.com/news/halo-reach-won-t-launch-from-the-xbox-app-but-here-is-a-workaround-528444.shtml',\n",
|
||
" 'appliesTo': 'xbox,Gaming on Windows PCs,PC Gaming',\n",
|
||
" 'score': '13.29'},\n",
|
||
" {'question_clean': 'my games aren ’ t starting when i try to start game it closes out quickly and says something went wrong and comes up with error code per i ’ ve looked this code up and it there is no code',\n",
|
||
" 'answer_text_clean': \"It's tied to the current service alert which is being worked on. https://support.xbox.com/xbox-live-status?xr=shellnav\",\n",
|
||
" 'appliesTo': 'xbox,Games and Apps',\n",
|
||
" 'score': '9.90'},\n",
|
||
" {'question_clean': 'gta v saved game from pns won t sync to one i m trying to pick up where i left off story mode on gta v i copied saved games to the cloud on pns when i start up gta on xbox one it doesn t recognize there s anything to sync like other cloud data for games i ve played the past is this even option for gta v thanks advance',\n",
|
||
" 'answer_text_clean': \"If the game is backwards compatible you can upload the 360 save to the cloud and download it to your One to resume playing. GTA is not so you'll need to start over on the single player.\",\n",
|
||
" 'appliesTo': 'xbox,Games and Apps',\n",
|
||
" 'score': '9.76'}]}]"
|
||
]
|
||
},
|
||
"execution_count": 13,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"service.run(json.dumps([{\"subject\": \"My pc won't start:\",\"body\": \"My pc won't start:\"}]))"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": []
|
||
}
|
||
],
|
||
"metadata": {
|
||
"kernelspec": {
|
||
"display_name": "nlp",
|
||
"language": "python",
|
||
"name": "nlp"
|
||
},
|
||
"language_info": {
|
||
"codemirror_mode": {
|
||
"name": "ipython",
|
||
"version": 3
|
||
},
|
||
"file_extension": ".py",
|
||
"mimetype": "text/x-python",
|
||
"name": "python",
|
||
"nbconvert_exporter": "python",
|
||
"pygments_lexer": "ipython3",
|
||
"version": "3.6.9"
|
||
}
|
||
},
|
||
"nbformat": 4,
|
||
"nbformat_minor": 2
|
||
}
|