From 0f5e5e813bb8d7baa4884da1b1848c32ce7e83a7 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Thu, 10 Aug 2023 15:29:39 +0300 Subject: [PATCH 01/35] first commit --- annotators/fact_checking/Dockerfile | 17 + annotators/fact_checking/README.md | 22 + .../fact_checking/doc_retriever_config.json | 82 + annotators/fact_checking/requirements.txt | 13 + annotators/fact_checking/server.py | 84 + .../doc-retriever/environment.yml | 8 + .../service_configs/doc-retriever/service.yml | 34 + annotators/fact_checking/test.sh | 3 + annotators/fact_checking/utils.py | 202 + assistant_dists/dream/dev.yml | 6 + .../dream/docker-compose.override.yml | 24 +- assistant_dists/dream/pipeline_conf.json | 18 + .../ranking_based_response_selector/server.py | 44 +- .../ranking_based_response_selector/test.py | 21 +- state_formatters/dp_formatters.py | 9 + test_cand_ann.json | 4748 +++++++++++++++++ 16 files changed, 5315 insertions(+), 20 deletions(-) create mode 100644 annotators/fact_checking/Dockerfile create mode 100644 annotators/fact_checking/README.md create mode 100644 annotators/fact_checking/doc_retriever_config.json create mode 100644 annotators/fact_checking/requirements.txt create mode 100644 annotators/fact_checking/server.py create mode 100644 annotators/fact_checking/service_configs/doc-retriever/environment.yml create mode 100644 annotators/fact_checking/service_configs/doc-retriever/service.yml create mode 100755 annotators/fact_checking/test.sh create mode 100644 annotators/fact_checking/utils.py create mode 100644 test_cand_ann.json diff --git a/annotators/fact_checking/Dockerfile b/annotators/fact_checking/Dockerfile new file mode 100644 index 0000000000..535c906cab --- /dev/null +++ b/annotators/fact_checking/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.9.16 +WORKDIR /src + +COPY annotators/fact_checking/requirements.txt /src/requirements.txt +RUN pip install -r /src/requirements.txt + +ARG GENERATIVE_SERVICE_URL +ENV GENERATIVE_SERVICE_URL ${GENERATIVE_SERVICE_URL} +ARG GENERATIVE_TIMEOUT +ENV GENERATIVE_TIMEOUT ${GENERATIVE_TIMEOUT} +ARG GENERATIVE_SERVICE_CONFIG +ENV GENERATIVE_SERVICE_CONFIG ${GENERATIVE_SERVICE_CONFIG} + +COPY annotators/fact_checking /src +COPY common /src/common + +CMD gunicorn --workers=1 server:app -b 0.0.0.0:8182 --timeout=1200 diff --git a/annotators/fact_checking/README.md b/annotators/fact_checking/README.md new file mode 100644 index 0000000000..df2235345c --- /dev/null +++ b/annotators/fact_checking/README.md @@ -0,0 +1,22 @@ +# Document Retriever + +## Description + +Document Retriever is an annotator with two endpoints used to retrieve `PARAGRAPHS_NUM` document parts most relevant to the user request. + +1. **train_and_upload_model** endpoint converts the documents provided by the user to txt format (if necessary) and splits them into chunks of ~100 words. Chunks are then transformed into a TF-IDF matrix; the resulting vectors and the vectorizer are saved for future use. This step is performed only once, in the beginning of the dialog. +Documents (txt format), matrix, and vectorizer are uploaded to file server to be used by **return_candidates** endpoint and **dff_document_qa_llm** skill. +2. **return_candidates** endpoint downloads TF-IDF matrix and vectorizer from the file server. It then converts the user’s utterance into a TF-IDF vector and finds `PARAGRAPHS_NUM` candidates with highest cosine similarity among TF-IDF vectors of text chunks. + +## Parameters + +``` +CONFIG_PATH: configuration file with parameters for doc_retriever model +FILE_SERVER_TIMEOUT: timeout for request where files are stored +PARAGRAPHS_NUM: number of most relevant chunks to retrieve. Don't make this number too large or the chunks won't fit into LLM context! +DOC_PATH_OR_LINK: paths or link to the files to be use for Question Answering. If paths, those are paths to files in `documents` folder in dream. If links, those must point to a file, not an Internet page. NB: file paths/links must be separated by a comma and no whitespace. +``` + +## Dependencies + +- **return_candidates** endpoint depends on **train_and_upload_model** endpoint \ No newline at end of file diff --git a/annotators/fact_checking/doc_retriever_config.json b/annotators/fact_checking/doc_retriever_config.json new file mode 100644 index 0000000000..be9dd12a4e --- /dev/null +++ b/annotators/fact_checking/doc_retriever_config.json @@ -0,0 +1,82 @@ +{ + "dataset_reader": { + "class_name": "odqa_reader", + "data_path": "", + "save_path": "/data/odqa/userfile.db", + "dataset_format": "wiki" + }, + "dataset_iterator": { + "class_name": "sqlite_iterator", + "shuffle": false, + "load_path": "/data/odqa/userfile.db" + }, + "chainer": { + "in": [ + "docs" + ], + "in_y": [ + "doc_ids", + "doc_nums" + ], + "out": [ + "tfidf_doc_ids" + ], + "pipe": [ + { + "class_name": "hashing_tfidf_vectorizer", + "id": "vectorizer", + "fit_on": [ + "docs", + "doc_ids", + "doc_nums" + ], + "save_path": "/data/odqa/userfile_tfidf_matrix.npz", + "load_path": "/data/odqa/userfile_tfidf_matrix.npz", + "tokenizer": { + "class_name": "stream_spacy_tokenizer", + "lemmas": true, + "lowercase": true, + "filter_stopwords": true, + "ngram_range": [ + 1, + 2 + ] + } + }, + { + "class_name": "tfidf_ranker", + "top_n": 12, + "in": [ + "docs" + ], + "out": [ + "tfidf_doc_ids", + "tfidf_doc_scores" + ], + "vectorizer": "#vectorizer" + } + ] + }, + "train": { + "batch_size": 10000, + "evaluation_targets": [], + "class_name": "fit_trainer" + }, + "metadata": { + "variables": { + "ROOT_PATH": "~/.deeppavlov", + "DOWNLOADS_PATH": "{ROOT_PATH}/downloads", + "MODELS_PATH": "{ROOT_PATH}/models" + }, + "download": [ + { + "url": "http://files.deeppavlov.ai/datasets/wikipedia/enwiki.tar.gz", + "subdir": "{DOWNLOADS_PATH}" + }, + { + "url": "http://files.deeppavlov.ai/deeppavlov_data/en_odqa.tar.gz", + "subdir": "{MODELS_PATH}" + } + ] + } +} \ No newline at end of file diff --git a/annotators/fact_checking/requirements.txt b/annotators/fact_checking/requirements.txt new file mode 100644 index 0000000000..b14d3440c6 --- /dev/null +++ b/annotators/fact_checking/requirements.txt @@ -0,0 +1,13 @@ +flask==1.1.1 +itsdangerous==2.0.1 +gunicorn==19.9.0 +requests==2.22.0 +sentry-sdk[flask]==0.14.1 +healthcheck==1.3.3 +jinja2<=3.0.3 +Werkzeug<=2.0.3 +deeppavlov==1.1.1 +nltk==3.8.1 +spacy==3.5 +pypdfium2==4.16.0 +bs4==0.0.1 \ No newline at end of file diff --git a/annotators/fact_checking/server.py b/annotators/fact_checking/server.py new file mode 100644 index 0000000000..aa5c43a7e4 --- /dev/null +++ b/annotators/fact_checking/server.py @@ -0,0 +1,84 @@ +import logging +from os import getenv +import sentry_sdk +import json +from flask import Flask, jsonify, request +from sentry_sdk.integrations.flask import FlaskIntegration +from common.prompts import send_request_to_prompted_generative_service, compose_sending_variables + +# logging here because it conflicts with tf + +logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO) +logger = logging.getLogger(__name__) +sentry_sdk.init(dsn=getenv("SENTRY_DSN"), integrations=[FlaskIntegration()]) +app = Flask(__name__) + +EXTERNAL_SKILLS = ["factoid_qa", "dff_google_api_skill"] +ENVVARS_TO_SEND = getenv("ENVVARS_TO_SEND", None) +ENVVARS_TO_SEND = [] if ENVVARS_TO_SEND is None else ENVVARS_TO_SEND.split(",") +GENERATIVE_SERVICE_URL = getenv("GENERATIVE_SERVICE_URL") +GENERATIVE_TIMEOUT = int(getenv("GENERATIVE_TIMEOUT", 0)) +GENERATIVE_SERVICE_CONFIG = getenv("GENERATIVE_SERVICE_CONFIG") +if GENERATIVE_SERVICE_CONFIG: + with open(f"common/generative_configs/{GENERATIVE_SERVICE_CONFIG}", "r") as f: + GENERATIVE_SERVICE_CONFIG = json.load(f) + + +@app.route("/respond", methods=["POST"]) +def respond(): + hypotheses = request.json["hypotheses"] + human_uttr_attributes = request.json["human_uttr_attributes"] # CHECK HOW 2 GET + external_service_hyps = [hyp["text"] for hyp in hypotheses if hyp["skill_name"] in EXTERNAL_SKILLS] # considered correct (always) + internal_service_hyps = [hyp["text"] for hyp in hypotheses if hyp["skill_name"] not in EXTERNAL_SKILLS] # need to be checked + try: + results = [] + if len(external_service_hyps) == 0: + if len(internal_service_hyps) > 0: + logger.info(f"No external hypotheses to be used as ground truth. Marking all internal hypotheses as correct.") + results += ['Correct']*len(internal_service_hyps) # add always correct + else: + logger.info(f"No hypotheses provided.") + else: + logger.info(f"Checking whether internal hypotheses contradict to any of the external hypotheses.") + for external_hyp in external_service_hyps: + results += ['Correct'] * len(external_service_hyps) + if len(internal_service_hyps) > 0: + for internal_hyp in internal_service_hyps: + is_hyp_correct = True + for external_hyp in external_service_hyps: + curr_prompt = f'''Fact:{external_hyp} +Hypothesis: {internal_hyp} +Does Hypothesis contain any information that contradicts Fact? Always answer only Yes or No.''' + logger.info(f"Sending prompt to llm to fact-check:\n`{curr_prompt}`") + lm_service_kwargs = human_uttr_attributes.pop("lm_service_kwargs", None) + lm_service_kwargs = {} if lm_service_kwargs is None else lm_service_kwargs + envvars_to_send = ENVVARS_TO_SEND if len(ENVVARS_TO_SEND) else human_uttr_attributes.get("envvars_to_send", []) + sending_variables = compose_sending_variables( + lm_service_kwargs, + envvars_to_send, + **human_uttr_attributes, + ) + response = send_request_to_prompted_generative_service( + "", # нужен ли нам контекст и какой длины? + curr_prompt, + GENERATIVE_SERVICE_URL, + GENERATIVE_SERVICE_CONFIG, + GENERATIVE_TIMEOUT, + sending_variables, + ) + result = response[0] + logger.info(f"llm response: `{result}`") + if 'no' in result.lower(): + is_hyp_correct = False + if is_hyp_correct: + results += ["Correct"] + else: + results += ["Incorrect"] + except Exception as e: + logger.error(e) + results.append(["Correct"] * len(hypotheses)) + return jsonify(results) + + +if __name__ == "__main__": + app.run(debug=True, host="0.0.0.0", port=3000) diff --git a/annotators/fact_checking/service_configs/doc-retriever/environment.yml b/annotators/fact_checking/service_configs/doc-retriever/environment.yml new file mode 100644 index 0000000000..3964508e56 --- /dev/null +++ b/annotators/fact_checking/service_configs/doc-retriever/environment.yml @@ -0,0 +1,8 @@ +SERVICE_PORT: 8165 +SERVICE_NAME: doc_retriever +CONFIG_PATH: ./doc_retriever_config.json +DOC_PATH_OR_LINK: http://files.deeppavlov.ai/dream_data/documents_for_qa/test_file_dream_repo.html,http://files.deeppavlov.ai/dream_data/documents_for_qa/alphabet_financial_report.txt,http://files.deeppavlov.ai/dream_data/documents_for_qa/test_file_jurafsky_chatbots.pdf +PARAGRAPHS_NUM: 5 +FILE_SERVER_TIMEOUT: 30 +CUDA_VISIBLE_DEVICES: '0' +FLASK_APP: server diff --git a/annotators/fact_checking/service_configs/doc-retriever/service.yml b/annotators/fact_checking/service_configs/doc-retriever/service.yml new file mode 100644 index 0000000000..a53aa796d9 --- /dev/null +++ b/annotators/fact_checking/service_configs/doc-retriever/service.yml @@ -0,0 +1,34 @@ +name: doc-retriever +endpoints: + - train_and_upload_model + - return_candidates +compose: + env_file: + - .env + build: + args: + SERVICE_PORT: 8165 + SERVICE_NAME: doc_retriever + CONFIG_PATH: ./doc_retriever_config.json + DOC_PATH_OR_LINK: http://files.deeppavlov.ai/dream_data/documents_for_qa/test_file_dream_repo.html,http://files.deeppavlov.ai/dream_data/documents_for_qa/alphabet_financial_report.txt,http://files.deeppavlov.ai/dream_data/documents_for_qa/test_file_jurafsky_chatbots.pdf + PARAGRAPHS_NUM: 5 + FILE_SERVER_TIMEOUT: 30 + context: . + dockerfile: annotators/doc_retriever/Dockerfile + command: flask run -h 0.0.0.0 -p 8165 + environment: + - CUDA_VISIBLE_DEVICES=0 + - FLASK_APP=server + deploy: + resources: + limits: + memory: 5G + reservations: + memory: 5G + volumes: + - "./annotators/doc_retriever:/src" + - "./common:/src/common" + - "./documents:/src/documents" + ports: + - 8165:8165 +proxy: null diff --git a/annotators/fact_checking/test.sh b/annotators/fact_checking/test.sh new file mode 100755 index 0000000000..4c8a0d1983 --- /dev/null +++ b/annotators/fact_checking/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +# python test.py diff --git a/annotators/fact_checking/utils.py b/annotators/fact_checking/utils.py new file mode 100644 index 0000000000..180510d475 --- /dev/null +++ b/annotators/fact_checking/utils.py @@ -0,0 +1,202 @@ +import requests +import logging +import os +import random +import string +import time +import shutil +import pypdfium2 as pdfium + +from pathlib import PurePath +from bs4 import BeautifulSoup +from deeppavlov import train_model +from common.build_dataset import build_dataset +from urllib.parse import urlparse + + +logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO) +logger = logging.getLogger(__name__) + +FILE_SERVER_URL = os.environ.get("FILE_SERVER_URL", None) +FILE_SERVER_TIMEOUT = int(os.environ.get("FILE_SERVER_TIMEOUT", 30)) + + +def find_and_download_docs_if_needed(dialog, model_needs_train, filepaths_in_container, docs_and_links): + if "human_attributes" in dialog: + document_links_in_attr = dialog.get("human_attributes", [{}])[-1].get("documents", []) # new docs + processed_docs = dialog.get("bot", {}).get("attributes", {}).get("document_links", []) + if document_links_in_attr != processed_docs: + model_needs_train = True + download_files_and_save_links(document_links_in_attr, filepaths_in_container, docs_and_links) + else: + logger.info("No documents found anywhere.") + return document_links_in_attr, model_needs_train + + +def train_upload_return_attributes( + config, filepaths_in_container, document_links, docs_and_links, doc_needs_upload=False +): + logger.info("Started training model.") + build_dataset_and_train_model( + config, "/data/temporary_dataset/", filepaths_in_container + ) # filepaths_in_container are used to create a database to work with + logger.info("Started writing model files to server.") + model_id, db_link, matrix_link = upload_model_return_id_and_links( + "/data/odqa/userfile.db", "/data/odqa/userfile_tfidf_matrix.npz" + ) + if doc_needs_upload: # only if doc is not already on fileserver + document_links = upload_files_return_links(filepaths_in_container) + time.sleep(1) + bot_and_human_atts = { + "bot_attributes": { + "db_link": db_link, # todo: maybe replace db_link and matrix_link with model_id + "matrix_link": matrix_link, + "document_links": document_links, + }, + "human_attributes": { + "documents_qa_model": { + "model_id": model_id, + "document_ids_and_info": docs_and_links, + "document_links": document_links, + } + }, + } + return bot_and_human_atts + + +def upload_model_return_id_and_links(db_file, matrix_file): + model_id = generate_random_string(10) + db_link = upload_document(f"{model_id}.db", db_file, FILE_SERVER_URL) + matrix_link = upload_document(f"{model_id}.npz", matrix_file, FILE_SERVER_URL) + return model_id, db_link, matrix_link + + +def upload_files_return_links(filepaths_in_container): + document_links = [] + for filepath in filepaths_in_container: + new_filename = PurePath(filepath).name + # file already has a random-id name (assigned earlier), so we just get it + document_link = upload_document(new_filename, filepath, FILE_SERVER_URL) + document_links.append(document_link) + # save all the links to relevant files on server + # todo: in the future add to folder on server!!! + return document_links + + +def create_folders_if_not_exist(folders_list): + for folder in folders_list: + if not os.path.exists(folder): + os.mkdir(folder) + + +def remove_files_and_folders(files_list, folders_list): + for file in files_list: + os.remove(file) + for folder in folders_list: + shutil.rmtree(folder, ignore_errors=True) + logger.info("Files successfully written to server. Everyting removed from /data.") + + +def download_files_and_save_links(document_links, filepaths_in_container, docs_and_links): + for link in document_links: + filepath_in_container = download_file_to_data(link) + filepaths_in_container.append(filepath_in_container) + # we download all incoming files to /data and save paths + docs_and_links.append( + { + "document_id": PurePath(link).stem, + "initial_path_or_link": link, + } + ) # linking ids and initial file information + + +def move_files_and_save_paths(document_paths, filepaths_in_container, docs_and_links): + for filepath in document_paths: + file_id = generate_random_string(10) + filepath_in_container = f"/data/documents/{file_id}.txt" + orig_file_text = get_text_from_filepath(filepath) + with open(filepath_in_container, "w") as f: + f.write(orig_file_text) + # move all the files to /data (for uniformness all files are always stored there) + docs_and_links.append( + { + "document_id": PurePath(filepath_in_container).stem, + "initial_path_or_link": filepath, + } + ) # linking ids and initial filenames + filepaths_in_container.append(filepath_in_container) # save paths + + +def pdf_to_text(file): + pdf = pdfium.PdfDocument(file) # supports file path strings, bytes, and byte buffers + n_pages = len(pdf) + full_doc_text = "" + for page in range(n_pages): + page_index = pdf[page] + textpage = page_index.get_textpage() + text_all = textpage.get_text_range() + full_doc_text += text_all + return full_doc_text + + +def html_to_text(file): + soup = BeautifulSoup(file) + full_doc_text = soup.get_text(strip=True) + return full_doc_text + + +def get_text_from_filepath(filepath: str) -> str: + file_extension = PurePath(filepath).suffix + if "pdf" in file_extension: + full_doc_text = pdf_to_text(filepath) + elif "html" in file_extension: + with open(filepath, "r") as f: + html_doc = f.read() + full_doc_text = html_to_text(html_doc) + else: + with open(filepath, "r") as f: + full_doc_text = f.read() + return full_doc_text + + +def get_text_from_fileobject(file_object: str, file_extension: str) -> str: + if "pdf" in file_extension: + full_doc_text = pdf_to_text(file_object.content) + elif "html" in file_extension: + full_doc_text = html_to_text(file_object.text) + else: + full_doc_text = file_object.text + return full_doc_text + + +def generate_random_string(length: int) -> str: + characters = string.ascii_letters + string.digits + return "".join(random.choice(characters) for _ in range(length)) + + +def download_file_to_data(filepath: str) -> str: + file_id = generate_random_string(10) + file_extension = PurePath(filepath).suffix + filepath_in_container = f"/data/documents/{file_id}.txt" + orig_file = requests.get(filepath, timeout=FILE_SERVER_TIMEOUT) + orig_file_text = get_text_from_fileobject(orig_file, file_extension) + with open(filepath_in_container, "w") as f: + f.write(orig_file_text) + return filepath_in_container + + +def upload_document(filename, filepath, file_server_url): + server_url = urlparse(file_server_url) + resp = requests.post(file_server_url, files={"file": (filename, open(filepath, "rb"))}, timeout=30) + resp.raise_for_status() + download_link = resp.json()["downloadLink"] + download_link = urlparse(download_link)._replace(scheme=server_url.scheme, netloc=server_url.netloc).geturl() + return download_link + + +def build_dataset_and_train_model(model_config, dataset_path, doc_path_or_link): + print("Model is not trained.\nLet's train the model!\n\n") + build_dataset(dataset_path, doc_path_or_link) + print("Dataset built. Now training the model.") + train_model(model_config) + print("Model is trained.") diff --git a/assistant_dists/dream/dev.yml b/assistant_dists/dream/dev.yml index 37a460fd0d..cb162ac409 100644 --- a/assistant_dists/dream/dev.yml +++ b/assistant_dists/dream/dev.yml @@ -157,4 +157,10 @@ services: - "./common:/src/common" ports: - 8167:8167 + fact-checking: + volumes: + - "./annotators/fact_checking:/src" + - "./common:/src/common" + ports: + - 8182:8182 version: "3.7" diff --git a/assistant_dists/dream/docker-compose.override.yml b/assistant_dists/dream/docker-compose.override.yml index c203a6b206..4b181f7dfc 100644 --- a/assistant_dists/dream/docker-compose.override.yml +++ b/assistant_dists/dream/docker-compose.override.yml @@ -8,7 +8,8 @@ services: combined-classification:8087, fact-retrieval:8100, entity-detection:8103, sentence-ranker:8128, property-extraction:8136, prompt-selector:8135, openai-api-chatgpt:8145, dff-dream-persona-chatgpt-prompted-skill:8137, dff-dream-faq-prompted-skill:8170, - openai-api-chatgpt-16k:8167, summarization-annotator:8058, dialog-summarizer:8059" + openai-api-chatgpt-16k:8167, summarization-annotator:8058, dialog-summarizer:8059, + fact-checking:8182" WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-1000} HIGH_PRIORITY_INTENTS: 1 RESTRICTION_FOR_SENSITIVE_CASE: 1 @@ -26,6 +27,8 @@ services: SENTENCE_RANKER_ANNOTATION_NAME: sentence_ranker SENTENCE_RANKER_SERVICE_URL: http://sentence-ranker:8128/respond SENTENCE_RANKER_TIMEOUT: 3 + FACTUAL_CONFORMITY_SERVICE_URL: http://openai-api-chatgpt:8145/respond + FACTUAL_CONFORMITY_SERVICE_TIMEOUT: 5 N_UTTERANCES_CONTEXT: 5 FILTER_TOXIC_OR_BADLISTED: 1 FALLBACK_FILE: fallbacks_dream_en.json @@ -482,4 +485,23 @@ services: reservations: memory: 4G + fact-checking: + env_file: [ .env ] + build: + args: + GENERATIVE_SERVICE_URL: http://openai-api-chatgpt:8145/respond + GENERATIVE_TIMEOUT: 10 + GENERATIVE_SERVICE_CONFIG: openai-chatgpt.json + context: . + dockerfile: annotators/fact_checking/Dockerfile + command: flask run -h 0.0.0.0 -p 8182 + environment: + - FLASK_APP=server + deploy: + resources: + limits: + memory: 128M + reservations: + memory: 128M + version: '3.7' diff --git a/assistant_dists/dream/pipeline_conf.json b/assistant_dists/dream/pipeline_conf.json index 35825f1f75..bae3e9955c 100644 --- a/assistant_dists/dream/pipeline_conf.json +++ b/assistant_dists/dream/pipeline_conf.json @@ -395,6 +395,24 @@ "component": "components/XGwmAHtAOu0NDqqG3QCJw.yml", "service": "services/sentence_ranker/service_configs/sentence-ranker" } + }, + "fact_checking": { + "connector": { + "protocol": "http", + "timeout": 2.0, + "url": "http://fact-checking:8182/respond" + }, + "dialog_formatter": "state_formatters.dp_formatters:hypotheses_and_attributes", + "response_formatter": "state_formatters.dp_formatters:simple_formatter_service", + "previous_services": [ + "skills" + ], + "state_manager_method": "add_hypothesis_annotation_batch", + "is_enabled": true, + "source": { + "component": "components/LKHNon389plcdknoiefh.yml", + "service": "annotators/fact_checking/service_configs/fact-checking" + } } }, "skill_selectors": { diff --git a/response_selectors/ranking_based_response_selector/server.py b/response_selectors/ranking_based_response_selector/server.py index 4cd9adb175..a9824c6454 100644 --- a/response_selectors/ranking_based_response_selector/server.py +++ b/response_selectors/ranking_based_response_selector/server.py @@ -24,11 +24,15 @@ SENTENCE_RANKER_TIMEOUT = int(getenv("SENTENCE_RANKER_TIMEOUT")) FILTER_TOXIC_OR_BADLISTED = int(getenv("FILTER_TOXIC_OR_BADLISTED")) N_UTTERANCES_CONTEXT = int(getenv("N_UTTERANCES_CONTEXT")) +# FACTUAL_CONFORMITY_SERVICE_URL = getenv("FACTUAL_CONFORMITY_SERVICE_URL") +# FACTUAL_CONFORMITY_SERVICE_TIMEOUT = int(getenv("FACTUAL_CONFORMITY_SERVICE_TIMEOUT")) +# EXTERNAL_SKILLS = ["factoid_qa", "dff_google_api_skill"] +# ENVVARS_TO_SEND = getenv("ENVVARS_TO_SEND", None) +# ENVVARS_TO_SEND = [] if ENVVARS_TO_SEND is None else ENVVARS_TO_SEND.split(",") assert SENTENCE_RANKER_ANNOTATION_NAME or SENTENCE_RANKER_SERVICE_URL, logger.error( "Ranker service URL or annotator name should be given" ) - def filter_out_badlisted_or_toxic(hypotheses): clean_hypotheses = [] for hyp in hypotheses: @@ -40,6 +44,44 @@ def filter_out_badlisted_or_toxic(hypotheses): return clean_hypotheses +# def filter_out_false(hypotheses, human_uttr_attributes): +# try: +# ie_types = [ +# "external service" if hyp["skill_name"] in EXTERNAL_SKILLS else "internal service" for hyp in hypotheses +# ] +# hyps_and_ies = zip(hypotheses, ie_types) +# for hyp, ie in hyps_and_ies: +# curr_prompt = f'''Fact:{hyp} +# Hypothesis: {ie} +# Does Hypothesis contain any information that contradicts Fact? Only answer Yes or No.''' +# logger.info(f"filter_out_false sends prompt to llm:\n`{curr_prompt}`") +# lm_service_kwargs = human_uttr_attributes.pop("lm_service_kwargs", None) +# lm_service_kwargs = {} if lm_service_kwargs is None else lm_service_kwargs +# envvars_to_send = ENVVARS_TO_SEND if len(ENVVARS_TO_SEND) else human_uttr_attributes.get("envvars_to_send", []) +# sending_variables = compose_sending_variables( +# lm_service_kwargs, +# envvars_to_send, +# **human_uttr_attributes, +# ) +# response = send_request_to_prompted_generative_service( +# dialog_context, +# curr_prompt, +# GENERATIVE_SERVICE_URL, +# GENERATIVE_SERVICE_CONFIG, +# GENERATIVE_TIMEOUT, +# sending_variables, +# ) +# result = response[0] +# except Exception as e: +# sentry_sdk.capture_exception(e) +# logger.exception(e) +# result = select_response_by_scores(hypotheses, [hyp["confidence"] for hyp in hypotheses])[0] +# logger.info("Exception in LLM's invocation. Selected a response with the highest confidence.") +# logger.info(f"llm_based_response_selector selected:\n`{result}`") + +# return result + + def select_response_by_scores(hypotheses, scores): best_id = np.argmax(scores) result = hypotheses[best_id] diff --git a/response_selectors/ranking_based_response_selector/test.py b/response_selectors/ranking_based_response_selector/test.py index 88d88655bf..831abe74aa 100644 --- a/response_selectors/ranking_based_response_selector/test.py +++ b/response_selectors/ranking_based_response_selector/test.py @@ -1,19 +1,4 @@ -import requests -import json -from os import getenv +hyps_and_ies = [[1, 1], [2, 3]] - -SERVICE_PORT = getenv("SERVICE_PORT") - - -def main(): - with open("test_data.json", "r") as f: - data = json.load(f) - # To skip "Oh, and remember this dialog's id" that raises error due to absence of 'dialog_id' field in test_data. - data["dialogs"][0]["human_utterances"].append(data["dialogs"][0]["human_utterances"][0]) - result = requests.post(f"http://0.0.0.0:{SERVICE_PORT}/respond", json=data).json() - assert result[0][0] in ["program_y", "movie_tfidf_retrieval"], print(result) - - -if __name__ == "__main__": - main() +for hyp, ie in hyps_and_ies: + print(f"{hyp} {ie} \n\n") diff --git a/state_formatters/dp_formatters.py b/state_formatters/dp_formatters.py index 1707c1690a..5c052916ff 100755 --- a/state_formatters/dp_formatters.py +++ b/state_formatters/dp_formatters.py @@ -1,6 +1,7 @@ import logging from copy import deepcopy from typing import Dict, List +import json from common.utils import get_entities, get_intents @@ -557,6 +558,8 @@ def persona_bot_formatter(dialog: Dict): def cropped_dialog(dialog: Dict): + with open('test_cand_ann.json', 'w', encoding='utf-8') as f: + json.dump(dialog, f, ensure_ascii=False, indent=4) dialog = utils.get_last_n_turns(dialog) dialog = utils.remove_clarification_turns_from_dialog(dialog) dialog = utils.replace_with_annotated_utterances(dialog, mode="punct_sent") @@ -1245,3 +1248,9 @@ def dff_command_selector_skill_formatter(dialog: Dict) -> List[Dict]: batches[-1]["dialog_batch"][-1]["called_intents"] = called_intents batches[-1]["dialog_batch"][-1]["dialog_id"] = dialog.get("dialog_id", "unknown") return batches + + +def hypotheses_and_attributes(dialog: Dict) -> List[Dict]: + hypotheses = dialog["human_utterances"][-1]["hypotheses"] + human_uttr_attributes = [dialog["human_utterances"][-1]["annotations"] for _ in hypotheses] + return [{"hypotheses": hypotheses, "human_uttr_attributes": human_uttr_attributes}] \ No newline at end of file diff --git a/test_cand_ann.json b/test_cand_ann.json new file mode 100644 index 0000000000..eb419a1658 --- /dev/null +++ b/test_cand_ann.json @@ -0,0 +1,4748 @@ +{ + "_id": "64d4b9095c75901b774c6e54", + "dialog_id": "ccb940225c37d09c654e83448d85b9d4", + "utterances": [ + { + "utt_id": "62fe3760e03571d9203c72232b77582b", + "text": "hi", + "user": { + "id": "fbc32ff98e3a4b2d8a008247494a2553", + "user_external_id": "nfejviuewfiubfeiuvbwefioubuivwebofiboiuvw", + "persona": {}, + "profile": { + "name": null, + "gender": null, + "birthdate": null, + "location": null, + "home_coordinates": null, + "work_coordinates": null, + "occupation": null, + "income_per_year": null + }, + "attributes": { + "prompts_goals": {}, + "age_group": "", + "dff_dream_persona_prompted_skill_state": { + "context": { + "actor_state": {}, + "id": "320d6186-8994-4895-95fc-36a4490e2cc3", + "labels": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "misc": {}, + "requests": { + "0": "hi." + }, + "responses": { + "0": [ + [ + "Hello! It's lovely to meet you. How can I assist you today?", + 0.9, + {}, + {}, + { + "can_continue": "no" + } + ] + ] + }, + "validation": false + }, + "current_turn_dff_suspended": false, + "history": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "previous_human_utter_index": 0, + "shared_memory": {} + }, + "dff_shared_state": { + "cross_links": {}, + "cross_states": {} + }, + "disliked_skills": {}, + "used_links": {} + }, + "user_type": "human" + }, + "annotations": { + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.0, + "General_ChatIntent": 1.0, + "Information_DeliveryIntent": 0.0, + "Information_RequestIntent": 0.0, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.0, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.0, + "Topic_SwitchIntent": 0.0, + "User_InstructionIntent": 0.0 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.0, + "Entertainment_General": 0.0, + "Entertainment_Movies": 0.0, + "Entertainment_Music": 0.0, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 1.0, + "Politics": 0.0, + "Science_and_Technology": 0.0, + "Sports": 0.0 + }, + "cobot_topics": { + "Art_Event": 0.01, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.0, + "Literature": 0.0, + "Math": 0.0, + "Movies_TV": 0.01, + "Music": 0.0, + "News": 0.0, + "Other": 0.14, + "Pets_Animals": 0.02, + "Phatic": 0.0, + "Politics": 0.0, + "Psychology": 0.01, + "Religion": 0.0, + "SciTech": 0.12, + "Sex_Profanity": 0.0, + "Sports": 0.02, + "Travel_Geo": 0.32, + "Weather_Time": 0.35 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.02, + "Art&Hobbies": 0.01, + "ArtificialIntelligence": 0.01, + "Beauty": 0.04, + "Books&Literature": 0.0, + "Celebrities&Events": 0.01, + "Clothes": 0.02, + "Depression": 0.08, + "Disasters": 0.21, + "Education": 0.01, + "Family&Relationships": 0.02, + "Finance": 0.06, + "Food": 0.01, + "Gadgets": 0.02, + "Garden": 0.03, + "Health&Medicine": 0.02, + "Home&Design": 0.04, + "Job": 0.06, + "Leisure": 0.08, + "MassTransit": 0.02, + "Movies&Tv": 0.0, + "Music": 0.01, + "News": 0.02, + "PersonalTransport": 0.02, + "Politics": 0.01, + "Psychology": 0.01, + "Religion": 0.01, + "Science&Technology": 0.02, + "Space": 0.05, + "Sports": 0.02, + "Toys&Games": 0.01, + "Travel": 0.04, + "Videogames": 0.02 + }, + "emotion_classification": { + "anger": 0.01, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.25, + "neutral": 0.69, + "sadness": 0.02, + "surprise": 0.02 + }, + "factoid_classification": { + "is_conversational": 0.23, + "is_factoid": 0.77 + }, + "midas_classification": { + "appreciation": 0.01, + "clarifying_question": 0.0, + "command": 0.01, + "comment": 0.02, + "complaint": 0.03, + "dev_command": 0.01, + "neg_answer": 0.01, + "open_question_factual": 0.03, + "open_question_opinion": 0.0, + "open_question_personal": 0.0, + "opinion": 0.08, + "other_answers": 0.0, + "pos_answer": 0.01, + "statement": 0.79, + "yes_no_question": 0.01 + }, + "sentiment_classification": { + "negative": 0.09, + "neutral": 0.82, + "positive": 0.09 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.01, + "not_toxic": 0.98, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.01 + } + }, + "sentseg": { + "punct_sent": "hi.", + "segments": [ + "hi." + ] + }, + "prompt_selector": { + "max_similarity": 0.24786385893821716, + "prompts": [ + "dream_persona", + "dream_faq", + "dream_faq" + ] + }, + "ner": [ + [] + ], + "intent_catcher": { + "cant_do": { + "confidence": 0.0, + "detected": 0 + }, + "choose_topic": { + "confidence": 0.0, + "detected": 0 + }, + "doing_well": { + "confidence": 0.0, + "detected": 0 + }, + "dont_understand": { + "confidence": 0.0, + "detected": 0 + }, + "exit": { + "confidence": 0.0, + "detected": 0 + }, + "lets_chat_about": { + "confidence": 0.0, + "detected": 0 + }, + "no": { + "confidence": 0.0, + "detected": 0 + }, + "opinion_request": { + "confidence": 0.0, + "detected": 0 + }, + "repeat": { + "confidence": 0.0, + "detected": 0 + }, + "stupid": { + "confidence": 0.0, + "detected": 0 + }, + "tell_me_a_story": { + "confidence": 0.0, + "detected": 0 + }, + "tell_me_more": { + "confidence": 0.0, + "detected": 0 + }, + "topic_switching": { + "confidence": 0.0, + "detected": 0 + }, + "weather_forecast_intent": { + "confidence": 0.0, + "detected": 0 + }, + "what_are_you_talking_about": { + "confidence": 0.0, + "detected": 0 + }, + "what_can_you_do": { + "confidence": 0.0, + "detected": 0 + }, + "what_is_your_job": { + "confidence": 0.0, + "detected": 0 + }, + "what_is_your_name": { + "confidence": 0.0, + "detected": 0 + }, + "what_time": { + "confidence": 0.0, + "detected": 0 + }, + "where_are_you_from": { + "confidence": 0.0, + "detected": 0 + }, + "who_made_you": { + "confidence": 0.0, + "detected": 0 + }, + "yes": { + "confidence": 0.0, + "detected": 0 + } + }, + "entity_detection": {}, + "entity_linking": [], + "fact_retrieval": { + "facts": [], + "topic_facts": [] + }, + "wiki_parser": { + "animals_skill_entities_info": {}, + "entities_info": {}, + "topic_skill_entities_info": {}, + "utt_num": 1, + "wiki_skill_entities_info": {} + }, + "kbqa": { + "answer": "", + "confidence": 0.0, + "qa_system": "kbqa" + } + }, + "hypotheses": [ + { + "skill_name": "dummy_skill", + "annotations": { + "sentence_ranker": 0.2946605086326599, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.12, + "General_ChatIntent": 0.02, + "Information_DeliveryIntent": 0.01, + "Information_RequestIntent": 0.76, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.01, + "Opinion_ExpressionIntent": 0.02, + "Opinion_RequestIntent": 0.02, + "OtherIntent": 0.01, + "Topic_SwitchIntent": 0.03, + "User_InstructionIntent": 0.0 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.02, + "Entertainment_General": 0.01, + "Entertainment_Movies": 0.19, + "Entertainment_Music": 0.23, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.05, + "Politics": 0.01, + "Science_and_Technology": 0.45, + "Sports": 0.04 + }, + "cobot_topics": { + "Art_Event": 0.0, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.0, + "Literature": 0.0, + "Math": 0.0, + "Movies_TV": 0.01, + "Music": 0.01, + "News": 0.0, + "Other": 0.92, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.0, + "Psychology": 0.03, + "Religion": 0.01, + "SciTech": 0.01, + "Sex_Profanity": 0.0, + "Sports": 0.0, + "Travel_Geo": 0.0, + "Weather_Time": 0.0 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.01, + "Art&Hobbies": 0.01, + "ArtificialIntelligence": 0.03, + "Beauty": 0.01, + "Books&Literature": 0.0, + "Celebrities&Events": 0.01, + "Clothes": 0.02, + "Depression": 0.01, + "Disasters": 0.03, + "Education": 0.0, + "Family&Relationships": 0.01, + "Finance": 0.02, + "Food": 0.05, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.04, + "Home&Design": 0.01, + "Job": 0.09, + "Leisure": 0.03, + "MassTransit": 0.01, + "Movies&Tv": 0.06, + "Music": 0.07, + "News": 0.01, + "PersonalTransport": 0.0, + "Politics": 0.01, + "Psychology": 0.05, + "Religion": 0.02, + "Science&Technology": 0.04, + "Space": 0.26, + "Sports": 0.08, + "Toys&Games": 0.0, + "Travel": 0.01, + "Videogames": 0.0 + }, + "emotion_classification": { + "anger": 0.0, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.0, + "neutral": 0.0, + "sadness": 0.0, + "surprise": 0.99 + }, + "factoid_classification": { + "is_conversational": 0.75, + "is_factoid": 0.25 + }, + "midas_classification": { + "appreciation": 0.01, + "clarifying_question": 0.0, + "command": 0.13, + "comment": 0.0, + "complaint": 0.03, + "dev_command": 0.0, + "neg_answer": 0.0, + "open_question_factual": 0.33, + "open_question_opinion": 0.38, + "open_question_personal": 0.0, + "opinion": 0.01, + "other_answers": 0.02, + "pos_answer": 0.02, + "statement": 0.01, + "yes_no_question": 0.06 + }, + "sentiment_classification": { + "negative": 0.24, + "neutral": 0.68, + "positive": 0.07 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 0.99, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": {} + }, + "text": "I am a bit confused. What would you like to chat about?", + "confidence": 0.5, + "human_attributes": {}, + "bot_attributes": {}, + "type": "dummy" + }, + { + "skill_name": "dummy_skill", + "annotations": { + "sentence_ranker": 0.07921610027551651, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.01, + "General_ChatIntent": 0.02, + "Information_DeliveryIntent": 0.14, + "Information_RequestIntent": 0.75, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.01, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.0, + "Topic_SwitchIntent": 0.05, + "User_InstructionIntent": 0.01 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.0, + "Entertainment_General": 0.99, + "Entertainment_Movies": 0.0, + "Entertainment_Music": 0.0, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.0, + "Politics": 0.0, + "Science_and_Technology": 0.0, + "Sports": 0.0 + }, + "cobot_topics": { + "Art_Event": 0.0, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.09, + "Literature": 0.0, + "Math": 0.0, + "Movies_TV": 0.6, + "Music": 0.07, + "News": 0.0, + "Other": 0.04, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.01, + "Psychology": 0.02, + "Religion": 0.14, + "SciTech": 0.0, + "Sex_Profanity": 0.0, + "Sports": 0.01, + "Travel_Geo": 0.0, + "Weather_Time": 0.0 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.01, + "Beauty": 0.0, + "Books&Literature": 0.0, + "Celebrities&Events": 0.0, + "Clothes": 0.0, + "Depression": 0.01, + "Disasters": 0.0, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.0, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.0, + "Home&Design": 0.0, + "Job": 0.0, + "Leisure": 0.0, + "MassTransit": 0.0, + "Movies&Tv": 0.03, + "Music": 0.0, + "News": 0.01, + "PersonalTransport": 0.0, + "Politics": 0.01, + "Psychology": 0.02, + "Religion": 0.5, + "Science&Technology": 0.04, + "Space": 0.0, + "Sports": 0.0, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.34 + }, + "emotion_classification": { + "anger": 0.02, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.79, + "neutral": 0.1, + "sadness": 0.02, + "surprise": 0.07 + }, + "factoid_classification": { + "is_conversational": 0.72, + "is_factoid": 0.28 + }, + "midas_classification": { + "appreciation": 0.01, + "clarifying_question": 0.0, + "command": 0.64, + "comment": 0.01, + "complaint": 0.02, + "dev_command": 0.0, + "neg_answer": 0.01, + "open_question_factual": 0.01, + "open_question_opinion": 0.02, + "open_question_personal": 0.0, + "opinion": 0.13, + "other_answers": 0.01, + "pos_answer": 0.08, + "statement": 0.02, + "yes_no_question": 0.04 + }, + "sentiment_classification": { + "negative": 0.03, + "neutral": 0.85, + "positive": 0.12 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 0.99, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": { + "entities": [ + "video games", + "games", + "video games" + ], + "labelled_entities": [ + { + "finegrained_label": [ + [ + "misc", + 0.9953 + ] + ], + "label": "misc", + "offsets": [ + 51, + 62 + ], + "text": "video games" + }, + { + "finegrained_label": [ + [ + "misc", + 0.9979 + ] + ], + "label": "misc", + "offsets": [ + 144, + 149 + ], + "text": "games" + }, + { + "finegrained_label": [ + [ + "misc", + 0.9964 + ] + ], + "label": "misc", + "offsets": [ + 163, + 174 + ], + "text": "video games" + } + ] + } + }, + "text": "I wanted to mention that, The obvious objective of video games is to entertain people by surprising them with new experiences. Let's talk about games, do you love video games?", + "confidence": 0.05, + "human_attributes": { + "used_links": { + "game_cooperative_skill": [ + "I wanted to mention that, The obvious objective of video games is to entertain people by surprising them with new experiences. Let's talk about games, do you love video games?" + ] + }, + "used_wiki_topics": [], + "disliked_skills": [], + "prelinkto_connections": [ + "The obvious objective of video games is to entertain people by surprising them with new experiences." + ] + }, + "bot_attributes": {}, + "type": "link_to_for_response_selector", + "response_parts": [ + "prompt" + ] + }, + { + "skill_name": "dff_dream_persona_prompted_skill", + "annotations": { + "sentence_ranker": 0.4212228059768677, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.06, + "General_ChatIntent": 0.74, + "Information_DeliveryIntent": 0.04, + "Information_RequestIntent": 0.08, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.0, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.06, + "Topic_SwitchIntent": 0.01, + "User_InstructionIntent": 0.01 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.01, + "Entertainment_General": 0.02, + "Entertainment_Movies": 0.02, + "Entertainment_Music": 0.07, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.82, + "Politics": 0.0, + "Science_and_Technology": 0.01, + "Sports": 0.06 + }, + "cobot_topics": { + "Art_Event": 0.01, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.0, + "Literature": 0.01, + "Math": 0.0, + "Movies_TV": 0.0, + "Music": 0.01, + "News": 0.0, + "Other": 0.43, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.01, + "Psychology": 0.01, + "Religion": 0.49, + "SciTech": 0.0, + "Sex_Profanity": 0.0, + "Sports": 0.02, + "Travel_Geo": 0.01, + "Weather_Time": 0.01 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.01, + "Beauty": 0.01, + "Books&Literature": 0.0, + "Celebrities&Events": 0.0, + "Clothes": 0.0, + "Depression": 0.0, + "Disasters": 0.09, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.01, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.02, + "Home&Design": 0.0, + "Job": 0.01, + "Leisure": 0.02, + "MassTransit": 0.0, + "Movies&Tv": 0.0, + "Music": 0.0, + "News": 0.01, + "PersonalTransport": 0.0, + "Politics": 0.0, + "Psychology": 0.0, + "Religion": 0.78, + "Science&Technology": 0.0, + "Space": 0.0, + "Sports": 0.01, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.0 + }, + "emotion_classification": { + "anger": 0.01, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.14, + "neutral": 0.22, + "sadness": 0.07, + "surprise": 0.56 + }, + "factoid_classification": { + "is_conversational": 0.49, + "is_factoid": 0.51 + }, + "midas_classification": { + "appreciation": 0.01, + "clarifying_question": 0.0, + "command": 0.34, + "comment": 0.01, + "complaint": 0.2, + "dev_command": 0.02, + "neg_answer": 0.01, + "open_question_factual": 0.06, + "open_question_opinion": 0.02, + "open_question_personal": 0.0, + "opinion": 0.09, + "other_answers": 0.01, + "pos_answer": 0.04, + "statement": 0.13, + "yes_no_question": 0.06 + }, + "sentiment_classification": { + "negative": 0.1, + "neutral": 0.63, + "positive": 0.27 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 1.0, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": {} + }, + "text": "Hello! It's lovely to meet you. How can I assist you today?", + "confidence": 0.9, + "human_attributes": { + "age_group": "", + "dff_dream_persona_prompted_skill_state": { + "context": { + "actor_state": {}, + "id": "320d6186-8994-4895-95fc-36a4490e2cc3", + "labels": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "misc": {}, + "requests": { + "0": "hi." + }, + "responses": { + "0": [ + [ + "Hello! It's lovely to meet you. How can I assist you today?", + 0.9, + {}, + {}, + { + "can_continue": "no" + } + ] + ] + }, + "validation": false + }, + "current_turn_dff_suspended": false, + "history": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "previous_human_utter_index": 0, + "shared_memory": {} + }, + "dff_shared_state": { + "cross_links": {}, + "cross_states": {} + }, + "disliked_skills": {}, + "prompts_goals": {}, + "used_links": {} + }, + "bot_attributes": {}, + "can_continue": "no", + "is_final_answer": "true" + }, + { + "skill_name": "dff_dream_faq_prompted_skill", + "annotations": { + "sentence_ranker": 0.4034996032714844, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.44, + "General_ChatIntent": 0.32, + "Information_DeliveryIntent": 0.1, + "Information_RequestIntent": 0.12, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.0, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.01, + "Topic_SwitchIntent": 0.0, + "User_InstructionIntent": 0.01 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.02, + "Entertainment_General": 0.03, + "Entertainment_Movies": 0.11, + "Entertainment_Music": 0.14, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.54, + "Politics": 0.0, + "Science_and_Technology": 0.02, + "Sports": 0.13 + }, + "cobot_topics": { + "Art_Event": 0.01, + "Celebrities": 0.01, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.0, + "Literature": 0.02, + "Math": 0.0, + "Movies_TV": 0.0, + "Music": 0.01, + "News": 0.0, + "Other": 0.5, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.01, + "Psychology": 0.01, + "Religion": 0.27, + "SciTech": 0.03, + "Sex_Profanity": 0.0, + "Sports": 0.07, + "Travel_Geo": 0.03, + "Weather_Time": 0.01 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.0, + "Beauty": 0.0, + "Books&Literature": 0.0, + "Celebrities&Events": 0.01, + "Clothes": 0.0, + "Depression": 0.0, + "Disasters": 0.87, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.0, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.01, + "Home&Design": 0.0, + "Job": 0.0, + "Leisure": 0.0, + "MassTransit": 0.0, + "Movies&Tv": 0.0, + "Music": 0.0, + "News": 0.01, + "PersonalTransport": 0.0, + "Politics": 0.0, + "Psychology": 0.0, + "Religion": 0.05, + "Science&Technology": 0.0, + "Space": 0.0, + "Sports": 0.01, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.0 + }, + "emotion_classification": { + "anger": 0.0, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.01, + "neutral": 0.25, + "sadness": 0.02, + "surprise": 0.73 + }, + "factoid_classification": { + "is_conversational": 0.28, + "is_factoid": 0.72 + }, + "midas_classification": { + "appreciation": 0.0, + "clarifying_question": 0.0, + "command": 0.14, + "comment": 0.0, + "complaint": 0.17, + "dev_command": 0.01, + "neg_answer": 0.01, + "open_question_factual": 0.34, + "open_question_opinion": 0.01, + "open_question_personal": 0.0, + "opinion": 0.11, + "other_answers": 0.01, + "pos_answer": 0.01, + "statement": 0.14, + "yes_no_question": 0.05 + }, + "sentiment_classification": { + "negative": 0.04, + "neutral": 0.93, + "positive": 0.03 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 1.0, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": {} + }, + "text": "Hello! How can I assist you today?", + "confidence": 0.9, + "human_attributes": { + "age_group": "", + "dff_dream_faq_prompted_skill_state": { + "context": { + "actor_state": {}, + "id": "a948e1fd-6356-4261-a356-ffdb0b555e10", + "labels": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "misc": {}, + "requests": { + "0": "hi." + }, + "responses": { + "0": [ + [ + "Hello! How can I assist you today?", + 0.9, + {}, + {}, + { + "can_continue": "no", + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + } + } + ] + ] + }, + "validation": false + }, + "current_turn_dff_suspended": false, + "history": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "previous_human_utter_index": 0, + "shared_memory": {} + }, + "dff_shared_state": { + "cross_links": {}, + "cross_states": {} + }, + "disliked_skills": {}, + "prompts_goals": {}, + "used_links": {} + }, + "bot_attributes": {}, + "can_continue": "no", + "is_final_answer": "true", + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + } + } + ], + "date_time": "2023-08-10 10:16:39.741000", + "attributes": {} + }, + { + "utt_id": "acdd897e1ae32fb2c160072221a207f1", + "text": "Hello! It's lovely to meet you. How can I assist you today?", + "orig_text": "Hello! It's lovely to meet you. How can I assist you today?", + "active_skill": "dff_dream_persona_prompted_skill", + "confidence": 0.9, + "annotations": { + "sentseg": { + "punct_sent": "Hello! It's lovely to meet you. How can I assist you today?", + "segments": [ + "Hello!", + "It's lovely to meet you.", + "How can I assist you today?" + ] + }, + "ner": [ + [ + { + "confidence": 1, + "end_pos": 1, + "start_pos": 0, + "text": "Hello", + "type": "CARDINAL" + } + ], + [], + [] + ] + }, + "date_time": "2023-08-10 10:16:41.788000", + "user": { + "id": "089e50bfc4fa483bb408d0264b8f6ef4", + "persona": {}, + "attributes": { + "summarized_dialog": "" + }, + "user_type": "bot" + }, + "attributes": { + "can_continue": "no", + "is_final_answer": "true" + } + }, + { + "utt_id": "fb601e129d46883a8b4aada85d8ec72b", + "text": "source /home/smilga/dream/venv/bin/activate", + "user": { + "id": "64d4b9095c75901b774c6e52", + "user_external_id": "nfejviuewfiubfeiuvbwefioubuivwebofiboiuvw", + "persona": {}, + "profile": { + "name": null, + "gender": null, + "birthdate": null, + "location": null, + "home_coordinates": null, + "work_coordinates": null, + "occupation": null, + "income_per_year": null + }, + "attributes": { + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + }, + "age_group": "", + "dff_dream_persona_prompted_skill_state": { + "context": { + "actor_state": {}, + "id": "320d6186-8994-4895-95fc-36a4490e2cc3", + "labels": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "misc": {}, + "requests": { + "0": "hi." + }, + "responses": { + "0": [ + [ + "Hello! It's lovely to meet you. How can I assist you today?", + 0.9, + {}, + {}, + { + "can_continue": "no" + } + ] + ] + }, + "validation": false + }, + "current_turn_dff_suspended": false, + "history": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "previous_human_utter_index": 0, + "shared_memory": {} + }, + "dff_shared_state": { + "cross_links": {}, + "cross_states": {} + }, + "disliked_skills": {}, + "used_links": {} + }, + "user_type": "human" + }, + "annotations": { + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.0, + "General_ChatIntent": 0.82, + "Information_DeliveryIntent": 0.14, + "Information_RequestIntent": 0.02, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.0, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.0, + "Topic_SwitchIntent": 0.0, + "User_InstructionIntent": 0.02 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.02, + "Entertainment_General": 0.6, + "Entertainment_Movies": 0.05, + "Entertainment_Music": 0.02, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.21, + "Politics": 0.0, + "Science_and_Technology": 0.04, + "Sports": 0.06 + }, + "cobot_topics": { + "Art_Event": 0.0, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.2, + "Literature": 0.01, + "Math": 0.01, + "Movies_TV": 0.05, + "Music": 0.02, + "News": 0.0, + "Other": 0.13, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.02, + "Psychology": 0.07, + "Religion": 0.01, + "SciTech": 0.42, + "Sex_Profanity": 0.0, + "Sports": 0.03, + "Travel_Geo": 0.02, + "Weather_Time": 0.01 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.0, + "Beauty": 0.0, + "Books&Literature": 0.0, + "Celebrities&Events": 0.0, + "Clothes": 0.0, + "Depression": 0.0, + "Disasters": 0.11, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.0, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.0, + "Home&Design": 0.0, + "Job": 0.01, + "Leisure": 0.0, + "MassTransit": 0.0, + "Movies&Tv": 0.0, + "Music": 0.0, + "News": 0.01, + "PersonalTransport": 0.0, + "Politics": 0.0, + "Psychology": 0.0, + "Religion": 0.01, + "Science&Technology": 0.02, + "Space": 0.02, + "Sports": 0.0, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.8 + }, + "emotion_classification": { + "anger": 0.0, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.01, + "neutral": 0.99, + "sadness": 0.0, + "surprise": 0.0 + }, + "factoid_classification": { + "is_conversational": 0.08, + "is_factoid": 0.92 + }, + "midas_classification": { + "appreciation": 0.0, + "clarifying_question": 0.0, + "command": 0.06, + "comment": 0.0, + "complaint": 0.0, + "dev_command": 0.02, + "neg_answer": 0.0, + "open_question_factual": 0.01, + "open_question_opinion": 0.0, + "open_question_personal": 0.0, + "opinion": 0.49, + "other_answers": 0.0, + "pos_answer": 0.0, + "statement": 0.41, + "yes_no_question": 0.0 + }, + "sentiment_classification": { + "negative": 0.01, + "neutral": 0.92, + "positive": 0.07 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 1.0, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "prompt_selector": { + "max_similarity": 0.2567436099052429, + "prompts": [ + "dream_persona", + "dream_faq" + ] + }, + "sentseg": { + "punct_sent": "source /home/smilga/dream/venv/bin/activate.", + "segments": [ + "source /home/smilga/dream/venv/bin/activate." + ] + }, + "ner": [ + [ + { + "confidence": 1, + "end_pos": 5, + "start_pos": 4, + "text": "smilga", + "type": "ORG" + } + ] + ], + "intent_catcher": { + "cant_do": { + "confidence": 0.0, + "detected": 0 + }, + "choose_topic": { + "confidence": 0.0, + "detected": 0 + }, + "doing_well": { + "confidence": 0.0, + "detected": 0 + }, + "dont_understand": { + "confidence": 0.0, + "detected": 0 + }, + "exit": { + "confidence": 0.0, + "detected": 0 + }, + "lets_chat_about": { + "confidence": 0.0, + "detected": 0 + }, + "no": { + "confidence": 0.0, + "detected": 0 + }, + "opinion_request": { + "confidence": 0.0, + "detected": 0 + }, + "repeat": { + "confidence": 0.0, + "detected": 0 + }, + "stupid": { + "confidence": 0.0, + "detected": 0 + }, + "tell_me_a_story": { + "confidence": 0.0, + "detected": 0 + }, + "tell_me_more": { + "confidence": 0.0, + "detected": 0 + }, + "topic_switching": { + "confidence": 0.0, + "detected": 0 + }, + "weather_forecast_intent": { + "confidence": 0.0, + "detected": 0 + }, + "what_are_you_talking_about": { + "confidence": 0.0, + "detected": 0 + }, + "what_can_you_do": { + "confidence": 0.0, + "detected": 0 + }, + "what_is_your_job": { + "confidence": 0.0, + "detected": 0 + }, + "what_is_your_name": { + "confidence": 0.0, + "detected": 0 + }, + "what_time": { + "confidence": 0.0, + "detected": 0 + }, + "where_are_you_from": { + "confidence": 0.0, + "detected": 0 + }, + "who_made_you": { + "confidence": 0.0, + "detected": 0 + }, + "yes": { + "confidence": 0.0, + "detected": 0 + } + }, + "entity_detection": {}, + "entity_linking": [], + "fact_retrieval": { + "facts": [], + "topic_facts": [] + }, + "kbqa": { + "answer": "", + "confidence": 0.0, + "qa_system": "kbqa" + }, + "wiki_parser": { + "animals_skill_entities_info": {}, + "entities_info": {}, + "topic_skill_entities_info": {}, + "utt_num": 2, + "wiki_skill_entities_info": {} + } + }, + "hypotheses": [ + { + "skill_name": "dummy_skill", + "annotations": { + "sentence_ranker": 0.04173866659402847, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.12, + "General_ChatIntent": 0.02, + "Information_DeliveryIntent": 0.01, + "Information_RequestIntent": 0.76, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.01, + "Opinion_ExpressionIntent": 0.02, + "Opinion_RequestIntent": 0.02, + "OtherIntent": 0.01, + "Topic_SwitchIntent": 0.03, + "User_InstructionIntent": 0.0 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.02, + "Entertainment_General": 0.01, + "Entertainment_Movies": 0.19, + "Entertainment_Music": 0.23, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.05, + "Politics": 0.01, + "Science_and_Technology": 0.45, + "Sports": 0.04 + }, + "cobot_topics": { + "Art_Event": 0.0, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.0, + "Literature": 0.0, + "Math": 0.0, + "Movies_TV": 0.01, + "Music": 0.01, + "News": 0.0, + "Other": 0.92, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.0, + "Psychology": 0.03, + "Religion": 0.01, + "SciTech": 0.01, + "Sex_Profanity": 0.0, + "Sports": 0.0, + "Travel_Geo": 0.0, + "Weather_Time": 0.0 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.01, + "Art&Hobbies": 0.01, + "ArtificialIntelligence": 0.03, + "Beauty": 0.01, + "Books&Literature": 0.0, + "Celebrities&Events": 0.01, + "Clothes": 0.02, + "Depression": 0.01, + "Disasters": 0.03, + "Education": 0.0, + "Family&Relationships": 0.01, + "Finance": 0.02, + "Food": 0.05, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.04, + "Home&Design": 0.01, + "Job": 0.09, + "Leisure": 0.03, + "MassTransit": 0.01, + "Movies&Tv": 0.06, + "Music": 0.07, + "News": 0.01, + "PersonalTransport": 0.0, + "Politics": 0.01, + "Psychology": 0.05, + "Religion": 0.02, + "Science&Technology": 0.04, + "Space": 0.26, + "Sports": 0.08, + "Toys&Games": 0.0, + "Travel": 0.01, + "Videogames": 0.0 + }, + "emotion_classification": { + "anger": 0.0, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.0, + "neutral": 0.0, + "sadness": 0.0, + "surprise": 0.99 + }, + "factoid_classification": { + "is_conversational": 0.75, + "is_factoid": 0.25 + }, + "midas_classification": { + "appreciation": 0.01, + "clarifying_question": 0.0, + "command": 0.13, + "comment": 0.0, + "complaint": 0.03, + "dev_command": 0.0, + "neg_answer": 0.0, + "open_question_factual": 0.33, + "open_question_opinion": 0.38, + "open_question_personal": 0.0, + "opinion": 0.01, + "other_answers": 0.02, + "pos_answer": 0.02, + "statement": 0.01, + "yes_no_question": 0.06 + }, + "sentiment_classification": { + "negative": 0.24, + "neutral": 0.68, + "positive": 0.07 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 0.99, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": {} + }, + "text": "I am a bit confused. What would you like to chat about?", + "confidence": 0.5, + "human_attributes": {}, + "bot_attributes": {}, + "type": "dummy" + }, + { + "skill_name": "dummy_skill", + "annotations": { + "sentence_ranker": -0.04437091201543808, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.02, + "General_ChatIntent": 0.18, + "Information_DeliveryIntent": 0.33, + "Information_RequestIntent": 0.13, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.01, + "Opinion_ExpressionIntent": 0.27, + "Opinion_RequestIntent": 0.01, + "OtherIntent": 0.02, + "Topic_SwitchIntent": 0.01, + "User_InstructionIntent": 0.03 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.07, + "Entertainment_General": 0.06, + "Entertainment_Movies": 0.06, + "Entertainment_Music": 0.67, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.01, + "Politics": 0.01, + "Science_and_Technology": 0.11, + "Sports": 0.01 + }, + "cobot_topics": { + "Art_Event": 0.0, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.0, + "Literature": 0.01, + "Math": 0.0, + "Movies_TV": 0.0, + "Music": 0.09, + "News": 0.0, + "Other": 0.0, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.0, + "Psychology": 0.85, + "Religion": 0.03, + "SciTech": 0.0, + "Sex_Profanity": 0.0, + "Sports": 0.0, + "Travel_Geo": 0.0, + "Weather_Time": 0.0 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.0, + "Beauty": 0.0, + "Books&Literature": 0.0, + "Celebrities&Events": 0.04, + "Clothes": 0.0, + "Depression": 0.01, + "Disasters": 0.0, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.0, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.0, + "Home&Design": 0.0, + "Job": 0.0, + "Leisure": 0.0, + "MassTransit": 0.0, + "Movies&Tv": 0.0, + "Music": 0.12, + "News": 0.02, + "PersonalTransport": 0.0, + "Politics": 0.0, + "Psychology": 0.43, + "Religion": 0.29, + "Science&Technology": 0.06, + "Space": 0.0, + "Sports": 0.0, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.0 + }, + "emotion_classification": { + "anger": 0.0, + "disgust": 0.0, + "fear": 0.01, + "joy": 0.92, + "neutral": 0.05, + "sadness": 0.01, + "surprise": 0.01 + }, + "factoid_classification": { + "is_conversational": 0.74, + "is_factoid": 0.26 + }, + "midas_classification": { + "appreciation": 0.05, + "clarifying_question": 0.0, + "command": 0.09, + "comment": 0.1, + "complaint": 0.01, + "dev_command": 0.02, + "neg_answer": 0.0, + "open_question_factual": 0.01, + "open_question_opinion": 0.02, + "open_question_personal": 0.0, + "opinion": 0.47, + "other_answers": 0.02, + "pos_answer": 0.12, + "statement": 0.05, + "yes_no_question": 0.03 + }, + "sentiment_classification": { + "negative": 0.09, + "neutral": 0.68, + "positive": 0.23 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 1.0, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": { + "entities": [ + "music", + "humanity", + "planet", + "music", + "music", + "band" + ], + "labelled_entities": [ + { + "finegrained_label": [ + [ + "misc", + 0.9971 + ] + ], + "label": "misc", + "offsets": [ + 34, + 39 + ], + "text": "music" + }, + { + "finegrained_label": [ + [ + "misc", + 0.9832 + ] + ], + "label": "misc", + "offsets": [ + 94, + 102 + ], + "text": "humanity" + }, + { + "finegrained_label": [ + [ + "misc", + 0.9887 + ] + ], + "label": "misc", + "offsets": [ + 157, + 163 + ], + "text": "planet" + }, + { + "finegrained_label": [ + [ + "misc", + 0.9974 + ] + ], + "label": "misc", + "offsets": [ + 191, + 196 + ], + "text": "music" + }, + { + "finegrained_label": [ + [ + "misc", + 0.9974 + ] + ], + "label": "misc", + "offsets": [ + 215, + 220 + ], + "text": "music" + }, + { + "finegrained_label": [ + [ + "misc", + 0.995 + ] + ], + "label": "misc", + "offsets": [ + 251, + 255 + ], + "text": "band" + } + ] + } + }, + "text": "I wanted to mention that, I think music in itself is healing. It's an explosive expression of humanity. It's something we are all touched by. No matter what planet we're from, everyone loves music. Let's talk about music, Who do you think is the best band ever?", + "confidence": 0.05, + "human_attributes": { + "used_links": { + "dff_music_skill": [ + "I wanted to mention that, I think music in itself is healing. It's an explosive expression of humanity. It's something we are all touched by. No matter what planet we're from, everyone loves music. Let's talk about music, Who do you think is the best band ever?" + ] + }, + "used_wiki_topics": [], + "disliked_skills": {}, + "prelinkto_connections": [ + "I think music in itself is healing. It's an explosive expression of humanity. It's something we are all touched by. No matter what planet we're from, everyone loves music." + ] + }, + "bot_attributes": {}, + "type": "link_to_for_response_selector", + "response_parts": [ + "prompt" + ] + }, + { + "skill_name": "dff_dream_faq_prompted_skill", + "annotations": { + "sentence_ranker": 0.4274880886077881, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.02, + "General_ChatIntent": 0.57, + "Information_DeliveryIntent": 0.26, + "Information_RequestIntent": 0.04, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.02, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.02, + "Topic_SwitchIntent": 0.04, + "User_InstructionIntent": 0.02 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.05, + "Entertainment_General": 0.1, + "Entertainment_Movies": 0.03, + "Entertainment_Music": 0.14, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.26, + "Politics": 0.01, + "Science_and_Technology": 0.4, + "Sports": 0.01 + }, + "cobot_topics": { + "Art_Event": 0.0, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.01, + "Games": 0.01, + "Literature": 0.01, + "Math": 0.02, + "Movies_TV": 0.0, + "Music": 0.05, + "News": 0.0, + "Other": 0.1, + "Pets_Animals": 0.03, + "Phatic": 0.0, + "Politics": 0.01, + "Psychology": 0.1, + "Religion": 0.0, + "SciTech": 0.6, + "Sex_Profanity": 0.01, + "Sports": 0.01, + "Travel_Geo": 0.0, + "Weather_Time": 0.04 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.04, + "Beauty": 0.0, + "Books&Literature": 0.0, + "Celebrities&Events": 0.0, + "Clothes": 0.0, + "Depression": 0.0, + "Disasters": 0.01, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.0, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.0, + "Home&Design": 0.0, + "Job": 0.9, + "Leisure": 0.0, + "MassTransit": 0.0, + "Movies&Tv": 0.0, + "Music": 0.0, + "News": 0.0, + "PersonalTransport": 0.0, + "Politics": 0.0, + "Psychology": 0.0, + "Religion": 0.0, + "Science&Technology": 0.02, + "Space": 0.01, + "Sports": 0.0, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.0 + }, + "emotion_classification": { + "anger": 0.31, + "disgust": 0.01, + "fear": 0.02, + "joy": 0.06, + "neutral": 0.41, + "sadness": 0.17, + "surprise": 0.03 + }, + "factoid_classification": { + "is_conversational": 0.06, + "is_factoid": 0.94 + }, + "midas_classification": { + "appreciation": 0.02, + "clarifying_question": 0.0, + "command": 0.15, + "comment": 0.03, + "complaint": 0.06, + "dev_command": 0.06, + "neg_answer": 0.02, + "open_question_factual": 0.05, + "open_question_opinion": 0.02, + "open_question_personal": 0.0, + "opinion": 0.25, + "other_answers": 0.03, + "pos_answer": 0.04, + "statement": 0.25, + "yes_no_question": 0.02 + }, + "sentiment_classification": { + "negative": 0.55, + "neutral": 0.44, + "positive": 0.01 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 0.99, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": { + "entities": [ + "software installations" + ], + "labelled_entities": [ + { + "finegrained_label": [ + [ + "misc", + 0.6953 + ] + ], + "label": "misc", + "offsets": [ + 70, + 92 + ], + "text": "software installations" + } + ] + } + }, + "text": "I'm sorry, but I'm unable to execute commands or assist with specific software installations. However, I'm here to answer any questions you may have about DeepPavlov Dream. Feel free to ask anything!", + "confidence": 0.9, + "human_attributes": { + "age_group": "", + "dff_dream_faq_prompted_skill_state": { + "context": { + "actor_state": {}, + "id": "cd7f9d3c-8a93-47af-9eb6-5b245565ff5c", + "labels": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "misc": {}, + "requests": { + "0": "source /home/smilga/dream/venv/bin/activate." + }, + "responses": { + "0": [ + [ + "I'm sorry, but I'm unable to execute commands or assist with specific software installations. However, I'm here to answer any questions you may have about DeepPavlov Dream. Feel free to ask anything!", + 0.9, + {}, + {}, + { + "can_continue": "no", + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + } + } + ] + ] + }, + "validation": false + }, + "current_turn_dff_suspended": false, + "history": { + "1": [ + "generation", + "generative_response_node" + ] + }, + "previous_human_utter_index": 1, + "shared_memory": {} + }, + "dff_shared_state": { + "cross_links": {}, + "cross_states": {} + }, + "disliked_skills": {}, + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + }, + "used_links": {} + }, + "bot_attributes": {}, + "can_continue": "no", + "is_final_answer": "true", + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + } + }, + { + "skill_name": "dff_dream_persona_prompted_skill", + "annotations": { + "sentence_ranker": 0.3869864344596863, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.01, + "General_ChatIntent": 0.36, + "Information_DeliveryIntent": 0.53, + "Information_RequestIntent": 0.02, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.01, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.01, + "Topic_SwitchIntent": 0.01, + "User_InstructionIntent": 0.03 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.02, + "Entertainment_General": 0.51, + "Entertainment_Movies": 0.06, + "Entertainment_Music": 0.07, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.06, + "Politics": 0.0, + "Science_and_Technology": 0.25, + "Sports": 0.02 + }, + "cobot_topics": { + "Art_Event": 0.01, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.02, + "Literature": 0.0, + "Math": 0.01, + "Movies_TV": 0.0, + "Music": 0.01, + "News": 0.0, + "Other": 0.02, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.0, + "Psychology": 0.02, + "Religion": 0.0, + "SciTech": 0.88, + "Sex_Profanity": 0.0, + "Sports": 0.0, + "Travel_Geo": 0.0, + "Weather_Time": 0.02 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.05, + "Beauty": 0.0, + "Books&Literature": 0.0, + "Celebrities&Events": 0.0, + "Clothes": 0.0, + "Depression": 0.0, + "Disasters": 0.07, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.0, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.0, + "Home&Design": 0.0, + "Job": 0.17, + "Leisure": 0.0, + "MassTransit": 0.0, + "Movies&Tv": 0.0, + "Music": 0.0, + "News": 0.0, + "PersonalTransport": 0.0, + "Politics": 0.0, + "Psychology": 0.0, + "Religion": 0.0, + "Science&Technology": 0.01, + "Space": 0.61, + "Sports": 0.0, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.08 + }, + "emotion_classification": { + "anger": 0.01, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.89, + "neutral": 0.04, + "sadness": 0.0, + "surprise": 0.05 + }, + "factoid_classification": { + "is_conversational": 0.04, + "is_factoid": 0.96 + }, + "midas_classification": { + "appreciation": 0.19, + "clarifying_question": 0.0, + "command": 0.05, + "comment": 0.05, + "complaint": 0.02, + "dev_command": 0.05, + "neg_answer": 0.01, + "open_question_factual": 0.03, + "open_question_opinion": 0.02, + "open_question_personal": 0.0, + "opinion": 0.15, + "other_answers": 0.02, + "pos_answer": 0.08, + "statement": 0.3, + "yes_no_question": 0.02 + }, + "sentiment_classification": { + "negative": 0.15, + "neutral": 0.33, + "positive": 0.52 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 0.98, + "obscene": 0.01, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.01 + } + }, + "entity_detection": { + "entities": [ + "virtual environment" + ], + "labelled_entities": [ + { + "finegrained_label": [ + [ + "misc", + 0.8303 + ] + ], + "label": "misc", + "offsets": [ + 42, + 61 + ], + "text": "virtual environment" + } + ] + } + }, + "text": "It seems like you're trying to activate a virtual environment! That command looks correct, but I'm unable to execute it myself as I am a chatbot. Is there anything else I can help you with?", + "confidence": 0.9, + "human_attributes": { + "age_group": "", + "dff_dream_persona_prompted_skill_state": { + "context": { + "actor_state": {}, + "id": "320d6186-8994-4895-95fc-36a4490e2cc3", + "labels": { + "0": [ + "generation", + "generative_response_node" + ], + "1": [ + "generation", + "generative_response_node" + ] + }, + "misc": {}, + "requests": { + "0": "hi.", + "1": "source /home/smilga/dream/venv/bin/activate." + }, + "responses": { + "0": [ + [ + "Hello! It's lovely to meet you. How can I assist you today?", + 0.9, + {}, + {}, + { + "can_continue": "no" + } + ] + ], + "1": [ + [ + "It seems like you're trying to activate a virtual environment! That command looks correct, but I'm unable to execute it myself as I am a chatbot. Is there anything else I can help you with?", + 0.9, + {}, + {}, + { + "can_continue": "no" + } + ] + ] + }, + "validation": false + }, + "current_turn_dff_suspended": false, + "history": { + "0": [ + "generation", + "generative_response_node" + ], + "1": [ + "generation", + "generative_response_node" + ] + }, + "previous_human_utter_index": 1, + "shared_memory": {} + }, + "dff_shared_state": { + "cross_links": {}, + "cross_states": {} + }, + "disliked_skills": {}, + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + }, + "used_links": {} + }, + "bot_attributes": {}, + "can_continue": "no", + "is_final_answer": "true" + } + ], + "date_time": "2023-08-10 12:10:35.006331", + "attributes": {} + } + ], + "human_utterances": [ + { + "utt_id": "62fe3760e03571d9203c72232b77582b", + "text": "hi", + "user": { + "id": "fbc32ff98e3a4b2d8a008247494a2553", + "user_external_id": "nfejviuewfiubfeiuvbwefioubuivwebofiboiuvw", + "persona": {}, + "profile": { + "name": null, + "gender": null, + "birthdate": null, + "location": null, + "home_coordinates": null, + "work_coordinates": null, + "occupation": null, + "income_per_year": null + }, + "attributes": { + "prompts_goals": {}, + "age_group": "", + "dff_dream_persona_prompted_skill_state": { + "context": { + "actor_state": {}, + "id": "320d6186-8994-4895-95fc-36a4490e2cc3", + "labels": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "misc": {}, + "requests": { + "0": "hi." + }, + "responses": { + "0": [ + [ + "Hello! It's lovely to meet you. How can I assist you today?", + 0.9, + {}, + {}, + { + "can_continue": "no" + } + ] + ] + }, + "validation": false + }, + "current_turn_dff_suspended": false, + "history": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "previous_human_utter_index": 0, + "shared_memory": {} + }, + "dff_shared_state": { + "cross_links": {}, + "cross_states": {} + }, + "disliked_skills": {}, + "used_links": {} + }, + "user_type": "human" + }, + "annotations": { + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.0, + "General_ChatIntent": 1.0, + "Information_DeliveryIntent": 0.0, + "Information_RequestIntent": 0.0, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.0, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.0, + "Topic_SwitchIntent": 0.0, + "User_InstructionIntent": 0.0 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.0, + "Entertainment_General": 0.0, + "Entertainment_Movies": 0.0, + "Entertainment_Music": 0.0, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 1.0, + "Politics": 0.0, + "Science_and_Technology": 0.0, + "Sports": 0.0 + }, + "cobot_topics": { + "Art_Event": 0.01, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.0, + "Literature": 0.0, + "Math": 0.0, + "Movies_TV": 0.01, + "Music": 0.0, + "News": 0.0, + "Other": 0.14, + "Pets_Animals": 0.02, + "Phatic": 0.0, + "Politics": 0.0, + "Psychology": 0.01, + "Religion": 0.0, + "SciTech": 0.12, + "Sex_Profanity": 0.0, + "Sports": 0.02, + "Travel_Geo": 0.32, + "Weather_Time": 0.35 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.02, + "Art&Hobbies": 0.01, + "ArtificialIntelligence": 0.01, + "Beauty": 0.04, + "Books&Literature": 0.0, + "Celebrities&Events": 0.01, + "Clothes": 0.02, + "Depression": 0.08, + "Disasters": 0.21, + "Education": 0.01, + "Family&Relationships": 0.02, + "Finance": 0.06, + "Food": 0.01, + "Gadgets": 0.02, + "Garden": 0.03, + "Health&Medicine": 0.02, + "Home&Design": 0.04, + "Job": 0.06, + "Leisure": 0.08, + "MassTransit": 0.02, + "Movies&Tv": 0.0, + "Music": 0.01, + "News": 0.02, + "PersonalTransport": 0.02, + "Politics": 0.01, + "Psychology": 0.01, + "Religion": 0.01, + "Science&Technology": 0.02, + "Space": 0.05, + "Sports": 0.02, + "Toys&Games": 0.01, + "Travel": 0.04, + "Videogames": 0.02 + }, + "emotion_classification": { + "anger": 0.01, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.25, + "neutral": 0.69, + "sadness": 0.02, + "surprise": 0.02 + }, + "factoid_classification": { + "is_conversational": 0.23, + "is_factoid": 0.77 + }, + "midas_classification": { + "appreciation": 0.01, + "clarifying_question": 0.0, + "command": 0.01, + "comment": 0.02, + "complaint": 0.03, + "dev_command": 0.01, + "neg_answer": 0.01, + "open_question_factual": 0.03, + "open_question_opinion": 0.0, + "open_question_personal": 0.0, + "opinion": 0.08, + "other_answers": 0.0, + "pos_answer": 0.01, + "statement": 0.79, + "yes_no_question": 0.01 + }, + "sentiment_classification": { + "negative": 0.09, + "neutral": 0.82, + "positive": 0.09 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.01, + "not_toxic": 0.98, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.01 + } + }, + "sentseg": { + "punct_sent": "hi.", + "segments": [ + "hi." + ] + }, + "prompt_selector": { + "max_similarity": 0.24786385893821716, + "prompts": [ + "dream_persona", + "dream_faq", + "dream_faq" + ] + }, + "ner": [ + [] + ], + "intent_catcher": { + "cant_do": { + "confidence": 0.0, + "detected": 0 + }, + "choose_topic": { + "confidence": 0.0, + "detected": 0 + }, + "doing_well": { + "confidence": 0.0, + "detected": 0 + }, + "dont_understand": { + "confidence": 0.0, + "detected": 0 + }, + "exit": { + "confidence": 0.0, + "detected": 0 + }, + "lets_chat_about": { + "confidence": 0.0, + "detected": 0 + }, + "no": { + "confidence": 0.0, + "detected": 0 + }, + "opinion_request": { + "confidence": 0.0, + "detected": 0 + }, + "repeat": { + "confidence": 0.0, + "detected": 0 + }, + "stupid": { + "confidence": 0.0, + "detected": 0 + }, + "tell_me_a_story": { + "confidence": 0.0, + "detected": 0 + }, + "tell_me_more": { + "confidence": 0.0, + "detected": 0 + }, + "topic_switching": { + "confidence": 0.0, + "detected": 0 + }, + "weather_forecast_intent": { + "confidence": 0.0, + "detected": 0 + }, + "what_are_you_talking_about": { + "confidence": 0.0, + "detected": 0 + }, + "what_can_you_do": { + "confidence": 0.0, + "detected": 0 + }, + "what_is_your_job": { + "confidence": 0.0, + "detected": 0 + }, + "what_is_your_name": { + "confidence": 0.0, + "detected": 0 + }, + "what_time": { + "confidence": 0.0, + "detected": 0 + }, + "where_are_you_from": { + "confidence": 0.0, + "detected": 0 + }, + "who_made_you": { + "confidence": 0.0, + "detected": 0 + }, + "yes": { + "confidence": 0.0, + "detected": 0 + } + }, + "entity_detection": {}, + "entity_linking": [], + "fact_retrieval": { + "facts": [], + "topic_facts": [] + }, + "wiki_parser": { + "animals_skill_entities_info": {}, + "entities_info": {}, + "topic_skill_entities_info": {}, + "utt_num": 1, + "wiki_skill_entities_info": {} + }, + "kbqa": { + "answer": "", + "confidence": 0.0, + "qa_system": "kbqa" + } + }, + "hypotheses": [ + { + "skill_name": "dummy_skill", + "annotations": { + "sentence_ranker": 0.2946605086326599, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.12, + "General_ChatIntent": 0.02, + "Information_DeliveryIntent": 0.01, + "Information_RequestIntent": 0.76, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.01, + "Opinion_ExpressionIntent": 0.02, + "Opinion_RequestIntent": 0.02, + "OtherIntent": 0.01, + "Topic_SwitchIntent": 0.03, + "User_InstructionIntent": 0.0 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.02, + "Entertainment_General": 0.01, + "Entertainment_Movies": 0.19, + "Entertainment_Music": 0.23, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.05, + "Politics": 0.01, + "Science_and_Technology": 0.45, + "Sports": 0.04 + }, + "cobot_topics": { + "Art_Event": 0.0, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.0, + "Literature": 0.0, + "Math": 0.0, + "Movies_TV": 0.01, + "Music": 0.01, + "News": 0.0, + "Other": 0.92, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.0, + "Psychology": 0.03, + "Religion": 0.01, + "SciTech": 0.01, + "Sex_Profanity": 0.0, + "Sports": 0.0, + "Travel_Geo": 0.0, + "Weather_Time": 0.0 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.01, + "Art&Hobbies": 0.01, + "ArtificialIntelligence": 0.03, + "Beauty": 0.01, + "Books&Literature": 0.0, + "Celebrities&Events": 0.01, + "Clothes": 0.02, + "Depression": 0.01, + "Disasters": 0.03, + "Education": 0.0, + "Family&Relationships": 0.01, + "Finance": 0.02, + "Food": 0.05, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.04, + "Home&Design": 0.01, + "Job": 0.09, + "Leisure": 0.03, + "MassTransit": 0.01, + "Movies&Tv": 0.06, + "Music": 0.07, + "News": 0.01, + "PersonalTransport": 0.0, + "Politics": 0.01, + "Psychology": 0.05, + "Religion": 0.02, + "Science&Technology": 0.04, + "Space": 0.26, + "Sports": 0.08, + "Toys&Games": 0.0, + "Travel": 0.01, + "Videogames": 0.0 + }, + "emotion_classification": { + "anger": 0.0, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.0, + "neutral": 0.0, + "sadness": 0.0, + "surprise": 0.99 + }, + "factoid_classification": { + "is_conversational": 0.75, + "is_factoid": 0.25 + }, + "midas_classification": { + "appreciation": 0.01, + "clarifying_question": 0.0, + "command": 0.13, + "comment": 0.0, + "complaint": 0.03, + "dev_command": 0.0, + "neg_answer": 0.0, + "open_question_factual": 0.33, + "open_question_opinion": 0.38, + "open_question_personal": 0.0, + "opinion": 0.01, + "other_answers": 0.02, + "pos_answer": 0.02, + "statement": 0.01, + "yes_no_question": 0.06 + }, + "sentiment_classification": { + "negative": 0.24, + "neutral": 0.68, + "positive": 0.07 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 0.99, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": {} + }, + "text": "I am a bit confused. What would you like to chat about?", + "confidence": 0.5, + "human_attributes": {}, + "bot_attributes": {}, + "type": "dummy" + }, + { + "skill_name": "dummy_skill", + "annotations": { + "sentence_ranker": 0.07921610027551651, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.01, + "General_ChatIntent": 0.02, + "Information_DeliveryIntent": 0.14, + "Information_RequestIntent": 0.75, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.01, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.0, + "Topic_SwitchIntent": 0.05, + "User_InstructionIntent": 0.01 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.0, + "Entertainment_General": 0.99, + "Entertainment_Movies": 0.0, + "Entertainment_Music": 0.0, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.0, + "Politics": 0.0, + "Science_and_Technology": 0.0, + "Sports": 0.0 + }, + "cobot_topics": { + "Art_Event": 0.0, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.09, + "Literature": 0.0, + "Math": 0.0, + "Movies_TV": 0.6, + "Music": 0.07, + "News": 0.0, + "Other": 0.04, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.01, + "Psychology": 0.02, + "Religion": 0.14, + "SciTech": 0.0, + "Sex_Profanity": 0.0, + "Sports": 0.01, + "Travel_Geo": 0.0, + "Weather_Time": 0.0 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.01, + "Beauty": 0.0, + "Books&Literature": 0.0, + "Celebrities&Events": 0.0, + "Clothes": 0.0, + "Depression": 0.01, + "Disasters": 0.0, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.0, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.0, + "Home&Design": 0.0, + "Job": 0.0, + "Leisure": 0.0, + "MassTransit": 0.0, + "Movies&Tv": 0.03, + "Music": 0.0, + "News": 0.01, + "PersonalTransport": 0.0, + "Politics": 0.01, + "Psychology": 0.02, + "Religion": 0.5, + "Science&Technology": 0.04, + "Space": 0.0, + "Sports": 0.0, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.34 + }, + "emotion_classification": { + "anger": 0.02, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.79, + "neutral": 0.1, + "sadness": 0.02, + "surprise": 0.07 + }, + "factoid_classification": { + "is_conversational": 0.72, + "is_factoid": 0.28 + }, + "midas_classification": { + "appreciation": 0.01, + "clarifying_question": 0.0, + "command": 0.64, + "comment": 0.01, + "complaint": 0.02, + "dev_command": 0.0, + "neg_answer": 0.01, + "open_question_factual": 0.01, + "open_question_opinion": 0.02, + "open_question_personal": 0.0, + "opinion": 0.13, + "other_answers": 0.01, + "pos_answer": 0.08, + "statement": 0.02, + "yes_no_question": 0.04 + }, + "sentiment_classification": { + "negative": 0.03, + "neutral": 0.85, + "positive": 0.12 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 0.99, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": { + "entities": [ + "video games", + "games", + "video games" + ], + "labelled_entities": [ + { + "finegrained_label": [ + [ + "misc", + 0.9953 + ] + ], + "label": "misc", + "offsets": [ + 51, + 62 + ], + "text": "video games" + }, + { + "finegrained_label": [ + [ + "misc", + 0.9979 + ] + ], + "label": "misc", + "offsets": [ + 144, + 149 + ], + "text": "games" + }, + { + "finegrained_label": [ + [ + "misc", + 0.9964 + ] + ], + "label": "misc", + "offsets": [ + 163, + 174 + ], + "text": "video games" + } + ] + } + }, + "text": "I wanted to mention that, The obvious objective of video games is to entertain people by surprising them with new experiences. Let's talk about games, do you love video games?", + "confidence": 0.05, + "human_attributes": { + "used_links": { + "game_cooperative_skill": [ + "I wanted to mention that, The obvious objective of video games is to entertain people by surprising them with new experiences. Let's talk about games, do you love video games?" + ] + }, + "used_wiki_topics": [], + "disliked_skills": [], + "prelinkto_connections": [ + "The obvious objective of video games is to entertain people by surprising them with new experiences." + ] + }, + "bot_attributes": {}, + "type": "link_to_for_response_selector", + "response_parts": [ + "prompt" + ] + }, + { + "skill_name": "dff_dream_persona_prompted_skill", + "annotations": { + "sentence_ranker": 0.4212228059768677, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.06, + "General_ChatIntent": 0.74, + "Information_DeliveryIntent": 0.04, + "Information_RequestIntent": 0.08, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.0, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.06, + "Topic_SwitchIntent": 0.01, + "User_InstructionIntent": 0.01 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.01, + "Entertainment_General": 0.02, + "Entertainment_Movies": 0.02, + "Entertainment_Music": 0.07, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.82, + "Politics": 0.0, + "Science_and_Technology": 0.01, + "Sports": 0.06 + }, + "cobot_topics": { + "Art_Event": 0.01, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.0, + "Literature": 0.01, + "Math": 0.0, + "Movies_TV": 0.0, + "Music": 0.01, + "News": 0.0, + "Other": 0.43, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.01, + "Psychology": 0.01, + "Religion": 0.49, + "SciTech": 0.0, + "Sex_Profanity": 0.0, + "Sports": 0.02, + "Travel_Geo": 0.01, + "Weather_Time": 0.01 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.01, + "Beauty": 0.01, + "Books&Literature": 0.0, + "Celebrities&Events": 0.0, + "Clothes": 0.0, + "Depression": 0.0, + "Disasters": 0.09, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.01, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.02, + "Home&Design": 0.0, + "Job": 0.01, + "Leisure": 0.02, + "MassTransit": 0.0, + "Movies&Tv": 0.0, + "Music": 0.0, + "News": 0.01, + "PersonalTransport": 0.0, + "Politics": 0.0, + "Psychology": 0.0, + "Religion": 0.78, + "Science&Technology": 0.0, + "Space": 0.0, + "Sports": 0.01, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.0 + }, + "emotion_classification": { + "anger": 0.01, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.14, + "neutral": 0.22, + "sadness": 0.07, + "surprise": 0.56 + }, + "factoid_classification": { + "is_conversational": 0.49, + "is_factoid": 0.51 + }, + "midas_classification": { + "appreciation": 0.01, + "clarifying_question": 0.0, + "command": 0.34, + "comment": 0.01, + "complaint": 0.2, + "dev_command": 0.02, + "neg_answer": 0.01, + "open_question_factual": 0.06, + "open_question_opinion": 0.02, + "open_question_personal": 0.0, + "opinion": 0.09, + "other_answers": 0.01, + "pos_answer": 0.04, + "statement": 0.13, + "yes_no_question": 0.06 + }, + "sentiment_classification": { + "negative": 0.1, + "neutral": 0.63, + "positive": 0.27 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 1.0, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": {} + }, + "text": "Hello! It's lovely to meet you. How can I assist you today?", + "confidence": 0.9, + "human_attributes": { + "age_group": "", + "dff_dream_persona_prompted_skill_state": { + "context": { + "actor_state": {}, + "id": "320d6186-8994-4895-95fc-36a4490e2cc3", + "labels": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "misc": {}, + "requests": { + "0": "hi." + }, + "responses": { + "0": [ + [ + "Hello! It's lovely to meet you. How can I assist you today?", + 0.9, + {}, + {}, + { + "can_continue": "no" + } + ] + ] + }, + "validation": false + }, + "current_turn_dff_suspended": false, + "history": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "previous_human_utter_index": 0, + "shared_memory": {} + }, + "dff_shared_state": { + "cross_links": {}, + "cross_states": {} + }, + "disliked_skills": {}, + "prompts_goals": {}, + "used_links": {} + }, + "bot_attributes": {}, + "can_continue": "no", + "is_final_answer": "true" + }, + { + "skill_name": "dff_dream_faq_prompted_skill", + "annotations": { + "sentence_ranker": 0.4034996032714844, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.44, + "General_ChatIntent": 0.32, + "Information_DeliveryIntent": 0.1, + "Information_RequestIntent": 0.12, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.0, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.01, + "Topic_SwitchIntent": 0.0, + "User_InstructionIntent": 0.01 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.02, + "Entertainment_General": 0.03, + "Entertainment_Movies": 0.11, + "Entertainment_Music": 0.14, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.54, + "Politics": 0.0, + "Science_and_Technology": 0.02, + "Sports": 0.13 + }, + "cobot_topics": { + "Art_Event": 0.01, + "Celebrities": 0.01, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.0, + "Literature": 0.02, + "Math": 0.0, + "Movies_TV": 0.0, + "Music": 0.01, + "News": 0.0, + "Other": 0.5, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.01, + "Psychology": 0.01, + "Religion": 0.27, + "SciTech": 0.03, + "Sex_Profanity": 0.0, + "Sports": 0.07, + "Travel_Geo": 0.03, + "Weather_Time": 0.01 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.0, + "Beauty": 0.0, + "Books&Literature": 0.0, + "Celebrities&Events": 0.01, + "Clothes": 0.0, + "Depression": 0.0, + "Disasters": 0.87, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.0, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.01, + "Home&Design": 0.0, + "Job": 0.0, + "Leisure": 0.0, + "MassTransit": 0.0, + "Movies&Tv": 0.0, + "Music": 0.0, + "News": 0.01, + "PersonalTransport": 0.0, + "Politics": 0.0, + "Psychology": 0.0, + "Religion": 0.05, + "Science&Technology": 0.0, + "Space": 0.0, + "Sports": 0.01, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.0 + }, + "emotion_classification": { + "anger": 0.0, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.01, + "neutral": 0.25, + "sadness": 0.02, + "surprise": 0.73 + }, + "factoid_classification": { + "is_conversational": 0.28, + "is_factoid": 0.72 + }, + "midas_classification": { + "appreciation": 0.0, + "clarifying_question": 0.0, + "command": 0.14, + "comment": 0.0, + "complaint": 0.17, + "dev_command": 0.01, + "neg_answer": 0.01, + "open_question_factual": 0.34, + "open_question_opinion": 0.01, + "open_question_personal": 0.0, + "opinion": 0.11, + "other_answers": 0.01, + "pos_answer": 0.01, + "statement": 0.14, + "yes_no_question": 0.05 + }, + "sentiment_classification": { + "negative": 0.04, + "neutral": 0.93, + "positive": 0.03 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 1.0, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": {} + }, + "text": "Hello! How can I assist you today?", + "confidence": 0.9, + "human_attributes": { + "age_group": "", + "dff_dream_faq_prompted_skill_state": { + "context": { + "actor_state": {}, + "id": "a948e1fd-6356-4261-a356-ffdb0b555e10", + "labels": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "misc": {}, + "requests": { + "0": "hi." + }, + "responses": { + "0": [ + [ + "Hello! How can I assist you today?", + 0.9, + {}, + {}, + { + "can_continue": "no", + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + } + } + ] + ] + }, + "validation": false + }, + "current_turn_dff_suspended": false, + "history": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "previous_human_utter_index": 0, + "shared_memory": {} + }, + "dff_shared_state": { + "cross_links": {}, + "cross_states": {} + }, + "disliked_skills": {}, + "prompts_goals": {}, + "used_links": {} + }, + "bot_attributes": {}, + "can_continue": "no", + "is_final_answer": "true", + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + } + } + ], + "date_time": "2023-08-10 10:16:39.741000", + "attributes": {} + }, + { + "utt_id": "fb601e129d46883a8b4aada85d8ec72b", + "text": "source /home/smilga/dream/venv/bin/activate", + "user": { + "id": "64d4b9095c75901b774c6e52", + "user_external_id": "nfejviuewfiubfeiuvbwefioubuivwebofiboiuvw", + "persona": {}, + "profile": { + "name": null, + "gender": null, + "birthdate": null, + "location": null, + "home_coordinates": null, + "work_coordinates": null, + "occupation": null, + "income_per_year": null + }, + "attributes": { + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + }, + "age_group": "", + "dff_dream_persona_prompted_skill_state": { + "context": { + "actor_state": {}, + "id": "320d6186-8994-4895-95fc-36a4490e2cc3", + "labels": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "misc": {}, + "requests": { + "0": "hi." + }, + "responses": { + "0": [ + [ + "Hello! It's lovely to meet you. How can I assist you today?", + 0.9, + {}, + {}, + { + "can_continue": "no" + } + ] + ] + }, + "validation": false + }, + "current_turn_dff_suspended": false, + "history": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "previous_human_utter_index": 0, + "shared_memory": {} + }, + "dff_shared_state": { + "cross_links": {}, + "cross_states": {} + }, + "disliked_skills": {}, + "used_links": {} + }, + "user_type": "human" + }, + "annotations": { + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.0, + "General_ChatIntent": 0.82, + "Information_DeliveryIntent": 0.14, + "Information_RequestIntent": 0.02, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.0, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.0, + "Topic_SwitchIntent": 0.0, + "User_InstructionIntent": 0.02 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.02, + "Entertainment_General": 0.6, + "Entertainment_Movies": 0.05, + "Entertainment_Music": 0.02, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.21, + "Politics": 0.0, + "Science_and_Technology": 0.04, + "Sports": 0.06 + }, + "cobot_topics": { + "Art_Event": 0.0, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.2, + "Literature": 0.01, + "Math": 0.01, + "Movies_TV": 0.05, + "Music": 0.02, + "News": 0.0, + "Other": 0.13, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.02, + "Psychology": 0.07, + "Religion": 0.01, + "SciTech": 0.42, + "Sex_Profanity": 0.0, + "Sports": 0.03, + "Travel_Geo": 0.02, + "Weather_Time": 0.01 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.0, + "Beauty": 0.0, + "Books&Literature": 0.0, + "Celebrities&Events": 0.0, + "Clothes": 0.0, + "Depression": 0.0, + "Disasters": 0.11, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.0, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.0, + "Home&Design": 0.0, + "Job": 0.01, + "Leisure": 0.0, + "MassTransit": 0.0, + "Movies&Tv": 0.0, + "Music": 0.0, + "News": 0.01, + "PersonalTransport": 0.0, + "Politics": 0.0, + "Psychology": 0.0, + "Religion": 0.01, + "Science&Technology": 0.02, + "Space": 0.02, + "Sports": 0.0, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.8 + }, + "emotion_classification": { + "anger": 0.0, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.01, + "neutral": 0.99, + "sadness": 0.0, + "surprise": 0.0 + }, + "factoid_classification": { + "is_conversational": 0.08, + "is_factoid": 0.92 + }, + "midas_classification": { + "appreciation": 0.0, + "clarifying_question": 0.0, + "command": 0.06, + "comment": 0.0, + "complaint": 0.0, + "dev_command": 0.02, + "neg_answer": 0.0, + "open_question_factual": 0.01, + "open_question_opinion": 0.0, + "open_question_personal": 0.0, + "opinion": 0.49, + "other_answers": 0.0, + "pos_answer": 0.0, + "statement": 0.41, + "yes_no_question": 0.0 + }, + "sentiment_classification": { + "negative": 0.01, + "neutral": 0.92, + "positive": 0.07 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 1.0, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "prompt_selector": { + "max_similarity": 0.2567436099052429, + "prompts": [ + "dream_persona", + "dream_faq" + ] + }, + "sentseg": { + "punct_sent": "source /home/smilga/dream/venv/bin/activate.", + "segments": [ + "source /home/smilga/dream/venv/bin/activate." + ] + }, + "ner": [ + [ + { + "confidence": 1, + "end_pos": 5, + "start_pos": 4, + "text": "smilga", + "type": "ORG" + } + ] + ], + "intent_catcher": { + "cant_do": { + "confidence": 0.0, + "detected": 0 + }, + "choose_topic": { + "confidence": 0.0, + "detected": 0 + }, + "doing_well": { + "confidence": 0.0, + "detected": 0 + }, + "dont_understand": { + "confidence": 0.0, + "detected": 0 + }, + "exit": { + "confidence": 0.0, + "detected": 0 + }, + "lets_chat_about": { + "confidence": 0.0, + "detected": 0 + }, + "no": { + "confidence": 0.0, + "detected": 0 + }, + "opinion_request": { + "confidence": 0.0, + "detected": 0 + }, + "repeat": { + "confidence": 0.0, + "detected": 0 + }, + "stupid": { + "confidence": 0.0, + "detected": 0 + }, + "tell_me_a_story": { + "confidence": 0.0, + "detected": 0 + }, + "tell_me_more": { + "confidence": 0.0, + "detected": 0 + }, + "topic_switching": { + "confidence": 0.0, + "detected": 0 + }, + "weather_forecast_intent": { + "confidence": 0.0, + "detected": 0 + }, + "what_are_you_talking_about": { + "confidence": 0.0, + "detected": 0 + }, + "what_can_you_do": { + "confidence": 0.0, + "detected": 0 + }, + "what_is_your_job": { + "confidence": 0.0, + "detected": 0 + }, + "what_is_your_name": { + "confidence": 0.0, + "detected": 0 + }, + "what_time": { + "confidence": 0.0, + "detected": 0 + }, + "where_are_you_from": { + "confidence": 0.0, + "detected": 0 + }, + "who_made_you": { + "confidence": 0.0, + "detected": 0 + }, + "yes": { + "confidence": 0.0, + "detected": 0 + } + }, + "entity_detection": {}, + "entity_linking": [], + "fact_retrieval": { + "facts": [], + "topic_facts": [] + }, + "kbqa": { + "answer": "", + "confidence": 0.0, + "qa_system": "kbqa" + }, + "wiki_parser": { + "animals_skill_entities_info": {}, + "entities_info": {}, + "topic_skill_entities_info": {}, + "utt_num": 2, + "wiki_skill_entities_info": {} + } + }, + "hypotheses": [ + { + "skill_name": "dummy_skill", + "annotations": { + "sentence_ranker": 0.04173866659402847, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.12, + "General_ChatIntent": 0.02, + "Information_DeliveryIntent": 0.01, + "Information_RequestIntent": 0.76, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.01, + "Opinion_ExpressionIntent": 0.02, + "Opinion_RequestIntent": 0.02, + "OtherIntent": 0.01, + "Topic_SwitchIntent": 0.03, + "User_InstructionIntent": 0.0 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.02, + "Entertainment_General": 0.01, + "Entertainment_Movies": 0.19, + "Entertainment_Music": 0.23, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.05, + "Politics": 0.01, + "Science_and_Technology": 0.45, + "Sports": 0.04 + }, + "cobot_topics": { + "Art_Event": 0.0, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.0, + "Literature": 0.0, + "Math": 0.0, + "Movies_TV": 0.01, + "Music": 0.01, + "News": 0.0, + "Other": 0.92, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.0, + "Psychology": 0.03, + "Religion": 0.01, + "SciTech": 0.01, + "Sex_Profanity": 0.0, + "Sports": 0.0, + "Travel_Geo": 0.0, + "Weather_Time": 0.0 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.01, + "Art&Hobbies": 0.01, + "ArtificialIntelligence": 0.03, + "Beauty": 0.01, + "Books&Literature": 0.0, + "Celebrities&Events": 0.01, + "Clothes": 0.02, + "Depression": 0.01, + "Disasters": 0.03, + "Education": 0.0, + "Family&Relationships": 0.01, + "Finance": 0.02, + "Food": 0.05, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.04, + "Home&Design": 0.01, + "Job": 0.09, + "Leisure": 0.03, + "MassTransit": 0.01, + "Movies&Tv": 0.06, + "Music": 0.07, + "News": 0.01, + "PersonalTransport": 0.0, + "Politics": 0.01, + "Psychology": 0.05, + "Religion": 0.02, + "Science&Technology": 0.04, + "Space": 0.26, + "Sports": 0.08, + "Toys&Games": 0.0, + "Travel": 0.01, + "Videogames": 0.0 + }, + "emotion_classification": { + "anger": 0.0, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.0, + "neutral": 0.0, + "sadness": 0.0, + "surprise": 0.99 + }, + "factoid_classification": { + "is_conversational": 0.75, + "is_factoid": 0.25 + }, + "midas_classification": { + "appreciation": 0.01, + "clarifying_question": 0.0, + "command": 0.13, + "comment": 0.0, + "complaint": 0.03, + "dev_command": 0.0, + "neg_answer": 0.0, + "open_question_factual": 0.33, + "open_question_opinion": 0.38, + "open_question_personal": 0.0, + "opinion": 0.01, + "other_answers": 0.02, + "pos_answer": 0.02, + "statement": 0.01, + "yes_no_question": 0.06 + }, + "sentiment_classification": { + "negative": 0.24, + "neutral": 0.68, + "positive": 0.07 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 0.99, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": {} + }, + "text": "I am a bit confused. What would you like to chat about?", + "confidence": 0.5, + "human_attributes": {}, + "bot_attributes": {}, + "type": "dummy" + }, + { + "skill_name": "dummy_skill", + "annotations": { + "sentence_ranker": -0.04437091201543808, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.02, + "General_ChatIntent": 0.18, + "Information_DeliveryIntent": 0.33, + "Information_RequestIntent": 0.13, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.01, + "Opinion_ExpressionIntent": 0.27, + "Opinion_RequestIntent": 0.01, + "OtherIntent": 0.02, + "Topic_SwitchIntent": 0.01, + "User_InstructionIntent": 0.03 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.07, + "Entertainment_General": 0.06, + "Entertainment_Movies": 0.06, + "Entertainment_Music": 0.67, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.01, + "Politics": 0.01, + "Science_and_Technology": 0.11, + "Sports": 0.01 + }, + "cobot_topics": { + "Art_Event": 0.0, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.0, + "Literature": 0.01, + "Math": 0.0, + "Movies_TV": 0.0, + "Music": 0.09, + "News": 0.0, + "Other": 0.0, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.0, + "Psychology": 0.85, + "Religion": 0.03, + "SciTech": 0.0, + "Sex_Profanity": 0.0, + "Sports": 0.0, + "Travel_Geo": 0.0, + "Weather_Time": 0.0 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.0, + "Beauty": 0.0, + "Books&Literature": 0.0, + "Celebrities&Events": 0.04, + "Clothes": 0.0, + "Depression": 0.01, + "Disasters": 0.0, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.0, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.0, + "Home&Design": 0.0, + "Job": 0.0, + "Leisure": 0.0, + "MassTransit": 0.0, + "Movies&Tv": 0.0, + "Music": 0.12, + "News": 0.02, + "PersonalTransport": 0.0, + "Politics": 0.0, + "Psychology": 0.43, + "Religion": 0.29, + "Science&Technology": 0.06, + "Space": 0.0, + "Sports": 0.0, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.0 + }, + "emotion_classification": { + "anger": 0.0, + "disgust": 0.0, + "fear": 0.01, + "joy": 0.92, + "neutral": 0.05, + "sadness": 0.01, + "surprise": 0.01 + }, + "factoid_classification": { + "is_conversational": 0.74, + "is_factoid": 0.26 + }, + "midas_classification": { + "appreciation": 0.05, + "clarifying_question": 0.0, + "command": 0.09, + "comment": 0.1, + "complaint": 0.01, + "dev_command": 0.02, + "neg_answer": 0.0, + "open_question_factual": 0.01, + "open_question_opinion": 0.02, + "open_question_personal": 0.0, + "opinion": 0.47, + "other_answers": 0.02, + "pos_answer": 0.12, + "statement": 0.05, + "yes_no_question": 0.03 + }, + "sentiment_classification": { + "negative": 0.09, + "neutral": 0.68, + "positive": 0.23 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 1.0, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": { + "entities": [ + "music", + "humanity", + "planet", + "music", + "music", + "band" + ], + "labelled_entities": [ + { + "finegrained_label": [ + [ + "misc", + 0.9971 + ] + ], + "label": "misc", + "offsets": [ + 34, + 39 + ], + "text": "music" + }, + { + "finegrained_label": [ + [ + "misc", + 0.9832 + ] + ], + "label": "misc", + "offsets": [ + 94, + 102 + ], + "text": "humanity" + }, + { + "finegrained_label": [ + [ + "misc", + 0.9887 + ] + ], + "label": "misc", + "offsets": [ + 157, + 163 + ], + "text": "planet" + }, + { + "finegrained_label": [ + [ + "misc", + 0.9974 + ] + ], + "label": "misc", + "offsets": [ + 191, + 196 + ], + "text": "music" + }, + { + "finegrained_label": [ + [ + "misc", + 0.9974 + ] + ], + "label": "misc", + "offsets": [ + 215, + 220 + ], + "text": "music" + }, + { + "finegrained_label": [ + [ + "misc", + 0.995 + ] + ], + "label": "misc", + "offsets": [ + 251, + 255 + ], + "text": "band" + } + ] + } + }, + "text": "I wanted to mention that, I think music in itself is healing. It's an explosive expression of humanity. It's something we are all touched by. No matter what planet we're from, everyone loves music. Let's talk about music, Who do you think is the best band ever?", + "confidence": 0.05, + "human_attributes": { + "used_links": { + "dff_music_skill": [ + "I wanted to mention that, I think music in itself is healing. It's an explosive expression of humanity. It's something we are all touched by. No matter what planet we're from, everyone loves music. Let's talk about music, Who do you think is the best band ever?" + ] + }, + "used_wiki_topics": [], + "disliked_skills": {}, + "prelinkto_connections": [ + "I think music in itself is healing. It's an explosive expression of humanity. It's something we are all touched by. No matter what planet we're from, everyone loves music." + ] + }, + "bot_attributes": {}, + "type": "link_to_for_response_selector", + "response_parts": [ + "prompt" + ] + }, + { + "skill_name": "dff_dream_faq_prompted_skill", + "annotations": { + "sentence_ranker": 0.4274880886077881, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.02, + "General_ChatIntent": 0.57, + "Information_DeliveryIntent": 0.26, + "Information_RequestIntent": 0.04, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.02, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.02, + "Topic_SwitchIntent": 0.04, + "User_InstructionIntent": 0.02 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.05, + "Entertainment_General": 0.1, + "Entertainment_Movies": 0.03, + "Entertainment_Music": 0.14, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.26, + "Politics": 0.01, + "Science_and_Technology": 0.4, + "Sports": 0.01 + }, + "cobot_topics": { + "Art_Event": 0.0, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.01, + "Games": 0.01, + "Literature": 0.01, + "Math": 0.02, + "Movies_TV": 0.0, + "Music": 0.05, + "News": 0.0, + "Other": 0.1, + "Pets_Animals": 0.03, + "Phatic": 0.0, + "Politics": 0.01, + "Psychology": 0.1, + "Religion": 0.0, + "SciTech": 0.6, + "Sex_Profanity": 0.01, + "Sports": 0.01, + "Travel_Geo": 0.0, + "Weather_Time": 0.04 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.04, + "Beauty": 0.0, + "Books&Literature": 0.0, + "Celebrities&Events": 0.0, + "Clothes": 0.0, + "Depression": 0.0, + "Disasters": 0.01, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.0, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.0, + "Home&Design": 0.0, + "Job": 0.9, + "Leisure": 0.0, + "MassTransit": 0.0, + "Movies&Tv": 0.0, + "Music": 0.0, + "News": 0.0, + "PersonalTransport": 0.0, + "Politics": 0.0, + "Psychology": 0.0, + "Religion": 0.0, + "Science&Technology": 0.02, + "Space": 0.01, + "Sports": 0.0, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.0 + }, + "emotion_classification": { + "anger": 0.31, + "disgust": 0.01, + "fear": 0.02, + "joy": 0.06, + "neutral": 0.41, + "sadness": 0.17, + "surprise": 0.03 + }, + "factoid_classification": { + "is_conversational": 0.06, + "is_factoid": 0.94 + }, + "midas_classification": { + "appreciation": 0.02, + "clarifying_question": 0.0, + "command": 0.15, + "comment": 0.03, + "complaint": 0.06, + "dev_command": 0.06, + "neg_answer": 0.02, + "open_question_factual": 0.05, + "open_question_opinion": 0.02, + "open_question_personal": 0.0, + "opinion": 0.25, + "other_answers": 0.03, + "pos_answer": 0.04, + "statement": 0.25, + "yes_no_question": 0.02 + }, + "sentiment_classification": { + "negative": 0.55, + "neutral": 0.44, + "positive": 0.01 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 0.99, + "obscene": 0.0, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.0 + } + }, + "entity_detection": { + "entities": [ + "software installations" + ], + "labelled_entities": [ + { + "finegrained_label": [ + [ + "misc", + 0.6953 + ] + ], + "label": "misc", + "offsets": [ + 70, + 92 + ], + "text": "software installations" + } + ] + } + }, + "text": "I'm sorry, but I'm unable to execute commands or assist with specific software installations. However, I'm here to answer any questions you may have about DeepPavlov Dream. Feel free to ask anything!", + "confidence": 0.9, + "human_attributes": { + "age_group": "", + "dff_dream_faq_prompted_skill_state": { + "context": { + "actor_state": {}, + "id": "cd7f9d3c-8a93-47af-9eb6-5b245565ff5c", + "labels": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "misc": {}, + "requests": { + "0": "source /home/smilga/dream/venv/bin/activate." + }, + "responses": { + "0": [ + [ + "I'm sorry, but I'm unable to execute commands or assist with specific software installations. However, I'm here to answer any questions you may have about DeepPavlov Dream. Feel free to ask anything!", + 0.9, + {}, + {}, + { + "can_continue": "no", + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + } + } + ] + ] + }, + "validation": false + }, + "current_turn_dff_suspended": false, + "history": { + "1": [ + "generation", + "generative_response_node" + ] + }, + "previous_human_utter_index": 1, + "shared_memory": {} + }, + "dff_shared_state": { + "cross_links": {}, + "cross_states": {} + }, + "disliked_skills": {}, + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + }, + "used_links": {} + }, + "bot_attributes": {}, + "can_continue": "no", + "is_final_answer": "true", + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + } + }, + { + "skill_name": "dff_dream_persona_prompted_skill", + "annotations": { + "sentence_ranker": 0.3869864344596863, + "combined_classification": { + "cobot_dialogact_intents": { + "ClarificationIntent": 0.01, + "General_ChatIntent": 0.36, + "Information_DeliveryIntent": 0.53, + "Information_RequestIntent": 0.02, + "InteractiveIntent": 0.0, + "Multiple_GoalsIntent": 0.0, + "Opinion_ExpressionIntent": 0.01, + "Opinion_RequestIntent": 0.0, + "OtherIntent": 0.01, + "Topic_SwitchIntent": 0.01, + "User_InstructionIntent": 0.03 + }, + "cobot_dialogact_topics": { + "Entertainment_Books": 0.02, + "Entertainment_General": 0.51, + "Entertainment_Movies": 0.06, + "Entertainment_Music": 0.07, + "Inappropriate_Content": 0.0, + "Interactive": 0.0, + "Other": 0.0, + "Phatic": 0.06, + "Politics": 0.0, + "Science_and_Technology": 0.25, + "Sports": 0.02 + }, + "cobot_topics": { + "Art_Event": 0.01, + "Celebrities": 0.0, + "Entertainment": 0.0, + "Fashion": 0.0, + "Food_Drink": 0.0, + "Games": 0.02, + "Literature": 0.0, + "Math": 0.01, + "Movies_TV": 0.0, + "Music": 0.01, + "News": 0.0, + "Other": 0.02, + "Pets_Animals": 0.0, + "Phatic": 0.0, + "Politics": 0.0, + "Psychology": 0.02, + "Religion": 0.0, + "SciTech": 0.88, + "Sex_Profanity": 0.0, + "Sports": 0.0, + "Travel_Geo": 0.0, + "Weather_Time": 0.02 + }, + "deeppavlov_topics": { + "Animals&Pets": 0.0, + "Art&Hobbies": 0.0, + "ArtificialIntelligence": 0.05, + "Beauty": 0.0, + "Books&Literature": 0.0, + "Celebrities&Events": 0.0, + "Clothes": 0.0, + "Depression": 0.0, + "Disasters": 0.07, + "Education": 0.0, + "Family&Relationships": 0.0, + "Finance": 0.0, + "Food": 0.0, + "Gadgets": 0.0, + "Garden": 0.0, + "Health&Medicine": 0.0, + "Home&Design": 0.0, + "Job": 0.17, + "Leisure": 0.0, + "MassTransit": 0.0, + "Movies&Tv": 0.0, + "Music": 0.0, + "News": 0.0, + "PersonalTransport": 0.0, + "Politics": 0.0, + "Psychology": 0.0, + "Religion": 0.0, + "Science&Technology": 0.01, + "Space": 0.61, + "Sports": 0.0, + "Toys&Games": 0.0, + "Travel": 0.0, + "Videogames": 0.08 + }, + "emotion_classification": { + "anger": 0.01, + "disgust": 0.0, + "fear": 0.0, + "joy": 0.89, + "neutral": 0.04, + "sadness": 0.0, + "surprise": 0.05 + }, + "factoid_classification": { + "is_conversational": 0.04, + "is_factoid": 0.96 + }, + "midas_classification": { + "appreciation": 0.19, + "clarifying_question": 0.0, + "command": 0.05, + "comment": 0.05, + "complaint": 0.02, + "dev_command": 0.05, + "neg_answer": 0.01, + "open_question_factual": 0.03, + "open_question_opinion": 0.02, + "open_question_personal": 0.0, + "opinion": 0.15, + "other_answers": 0.02, + "pos_answer": 0.08, + "statement": 0.3, + "yes_no_question": 0.02 + }, + "sentiment_classification": { + "negative": 0.15, + "neutral": 0.33, + "positive": 0.52 + }, + "toxic_classification": { + "identity_hate": 0.0, + "insult": 0.0, + "not_toxic": 0.98, + "obscene": 0.01, + "severe_toxic": 0.0, + "sexual_explicit": 0.0, + "threat": 0.0, + "toxic": 0.01 + } + }, + "entity_detection": { + "entities": [ + "virtual environment" + ], + "labelled_entities": [ + { + "finegrained_label": [ + [ + "misc", + 0.8303 + ] + ], + "label": "misc", + "offsets": [ + 42, + 61 + ], + "text": "virtual environment" + } + ] + } + }, + "text": "It seems like you're trying to activate a virtual environment! That command looks correct, but I'm unable to execute it myself as I am a chatbot. Is there anything else I can help you with?", + "confidence": 0.9, + "human_attributes": { + "age_group": "", + "dff_dream_persona_prompted_skill_state": { + "context": { + "actor_state": {}, + "id": "320d6186-8994-4895-95fc-36a4490e2cc3", + "labels": { + "0": [ + "generation", + "generative_response_node" + ], + "1": [ + "generation", + "generative_response_node" + ] + }, + "misc": {}, + "requests": { + "0": "hi.", + "1": "source /home/smilga/dream/venv/bin/activate." + }, + "responses": { + "0": [ + [ + "Hello! It's lovely to meet you. How can I assist you today?", + 0.9, + {}, + {}, + { + "can_continue": "no" + } + ] + ], + "1": [ + [ + "It seems like you're trying to activate a virtual environment! That command looks correct, but I'm unable to execute it myself as I am a chatbot. Is there anything else I can help you with?", + 0.9, + {}, + {}, + { + "can_continue": "no" + } + ] + ] + }, + "validation": false + }, + "current_turn_dff_suspended": false, + "history": { + "0": [ + "generation", + "generative_response_node" + ], + "1": [ + "generation", + "generative_response_node" + ] + }, + "previous_human_utter_index": 1, + "shared_memory": {} + }, + "dff_shared_state": { + "cross_links": {}, + "cross_states": {} + }, + "disliked_skills": {}, + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + }, + "used_links": {} + }, + "bot_attributes": {}, + "can_continue": "no", + "is_final_answer": "true" + } + ], + "date_time": "2023-08-10 12:10:35.006331", + "attributes": {} + } + ], + "bot_utterances": [ + { + "utt_id": "acdd897e1ae32fb2c160072221a207f1", + "text": "Hello! It's lovely to meet you. How can I assist you today?", + "orig_text": "Hello! It's lovely to meet you. How can I assist you today?", + "active_skill": "dff_dream_persona_prompted_skill", + "confidence": 0.9, + "annotations": { + "sentseg": { + "punct_sent": "Hello! It's lovely to meet you. How can I assist you today?", + "segments": [ + "Hello!", + "It's lovely to meet you.", + "How can I assist you today?" + ] + }, + "ner": [ + [ + { + "confidence": 1, + "end_pos": 1, + "start_pos": 0, + "text": "Hello", + "type": "CARDINAL" + } + ], + [], + [] + ] + }, + "date_time": "2023-08-10 10:16:41.788000", + "user": { + "id": "089e50bfc4fa483bb408d0264b8f6ef4", + "persona": {}, + "attributes": { + "summarized_dialog": "" + }, + "user_type": "bot" + }, + "attributes": { + "can_continue": "no", + "is_final_answer": "true" + } + } + ], + "human": { + "id": "64d4b9095c75901b774c6e52", + "user_external_id": "nfejviuewfiubfeiuvbwefioubuivwebofiboiuvw", + "persona": {}, + "profile": { + "name": null, + "gender": null, + "birthdate": null, + "location": null, + "home_coordinates": null, + "work_coordinates": null, + "occupation": null, + "income_per_year": null + }, + "attributes": { + "prompts_goals": { + "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." + }, + "age_group": "", + "dff_dream_persona_prompted_skill_state": { + "context": { + "actor_state": {}, + "id": "320d6186-8994-4895-95fc-36a4490e2cc3", + "labels": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "misc": {}, + "requests": { + "0": "hi." + }, + "responses": { + "0": [ + [ + "Hello! It's lovely to meet you. How can I assist you today?", + 0.9, + {}, + {}, + { + "can_continue": "no" + } + ] + ] + }, + "validation": false + }, + "current_turn_dff_suspended": false, + "history": { + "0": [ + "generation", + "generative_response_node" + ] + }, + "previous_human_utter_index": 0, + "shared_memory": {} + }, + "dff_shared_state": { + "cross_links": {}, + "cross_states": {} + }, + "disliked_skills": {}, + "used_links": {} + }, + "user_type": "human" + }, + "bot": { + "id": "64d4b9095c75901b774c6e53", + "persona": {}, + "attributes": { + "summarized_dialog": "" + }, + "user_type": "bot" + }, + "channel_type": "cmd_client", + "date_start": "2023-08-10 10:16:39.741000", + "date_finish": "2023-08-10 10:16:41.788000", + "_active": "True", + "attributes": { + "pipeline": [ + "annotators.sentseg", + "annotators.prompt_goals_collector", + "annotators.prompt_selector", + "annotators.intent_catcher", + "annotators.fact_retrieval", + "annotators.ner", + "annotators.entity_detection", + "annotators.kbqa", + "annotators.entity_linking", + "annotators.wiki_parser", + "annotators.combined_classification", + "annotators.summarization_annotator", + "response_annotators.sentseg", + "response_annotators.ner", + "response_annotator_selectors", + "candidate_annotators.entity_detection", + "candidate_annotators.combined_classification", + "candidate_annotators.sentence_ranker", + "candidate_annotators.fact_checking", + "skill_selectors.description_based_skill_selector", + "skills.dff_dream_persona_prompted_skill", + "skills.dff_google_api_skill", + "skills.dff_intent_responder_skill", + "skills.dummy_skill", + "skills.factoid_qa", + "skills.dff_dream_faq_prompted_skill", + "response_selectors.response_selector", + "input", + "responder" + ] + } +} \ No newline at end of file From dd2a93f338c3593e9b34a97943903af541ebacb6 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Thu, 10 Aug 2023 16:08:51 +0300 Subject: [PATCH 02/35] fix format of output --- annotators/fact_checking/server.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/annotators/fact_checking/server.py b/annotators/fact_checking/server.py index aa5c43a7e4..76cd95600d 100644 --- a/annotators/fact_checking/server.py +++ b/annotators/fact_checking/server.py @@ -77,8 +77,7 @@ def respond(): except Exception as e: logger.error(e) results.append(["Correct"] * len(hypotheses)) - return jsonify(results) - + return jsonify([{"batch": results}]) if __name__ == "__main__": - app.run(debug=True, host="0.0.0.0", port=3000) + app.run(debug=False, host="0.0.0.0", port=3000) From 02c711e43d72e9f8596bf3036789a4f63fd4ac79 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Thu, 10 Aug 2023 17:32:02 +0300 Subject: [PATCH 03/35] fixes --- annotators/fact_checking/server.py | 49 ++++++++++--------- .../dream/docker-compose.override.yml | 2 +- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/annotators/fact_checking/server.py b/annotators/fact_checking/server.py index 76cd95600d..92edd1504f 100644 --- a/annotators/fact_checking/server.py +++ b/annotators/fact_checking/server.py @@ -27,36 +27,34 @@ @app.route("/respond", methods=["POST"]) def respond(): hypotheses = request.json["hypotheses"] - human_uttr_attributes = request.json["human_uttr_attributes"] # CHECK HOW 2 GET + human_uttr_attributes = request.json["human_uttr_attributes"] + ie_types = ["external" if hyp["skill_name"] in EXTERNAL_SKILLS else "internal" for hyp in hypotheses] external_service_hyps = [hyp["text"] for hyp in hypotheses if hyp["skill_name"] in EXTERNAL_SKILLS] # considered correct (always) - internal_service_hyps = [hyp["text"] for hyp in hypotheses if hyp["skill_name"] not in EXTERNAL_SKILLS] # need to be checked - try: - results = [] - if len(external_service_hyps) == 0: - if len(internal_service_hyps) > 0: - logger.info(f"No external hypotheses to be used as ground truth. Marking all internal hypotheses as correct.") - results += ['Correct']*len(internal_service_hyps) # add always correct + results = [] + for hyp, human_uttr_attr, ie_type in zip(hypotheses, human_uttr_attributes, ie_types): + hyp_text = hyp["text"] + try: + if ie_type == "external": + logger.info(f"Hypothesis `{hyp_text}` is external so it is deemed correct.") + results += ["Correct"] else: - logger.info(f"No hypotheses provided.") - else: - logger.info(f"Checking whether internal hypotheses contradict to any of the external hypotheses.") - for external_hyp in external_service_hyps: - results += ['Correct'] * len(external_service_hyps) - if len(internal_service_hyps) > 0: - for internal_hyp in internal_service_hyps: + if len(external_service_hyps) == 0: # there are no external hyps to check upon + logger.info(f"Hypothesis {hyp_text} is is deemed correct because there are no external hypothesis to check it upon.") + results += ["Correct"] + else: is_hyp_correct = True - for external_hyp in external_service_hyps: - curr_prompt = f'''Fact:{external_hyp} -Hypothesis: {internal_hyp} + for external_service_hyp in external_service_hyps: + curr_prompt = f'''Fact: `{external_service_hyp}` +Hypothesis: `{hyp_text}` Does Hypothesis contain any information that contradicts Fact? Always answer only Yes or No.''' logger.info(f"Sending prompt to llm to fact-check:\n`{curr_prompt}`") - lm_service_kwargs = human_uttr_attributes.pop("lm_service_kwargs", None) + lm_service_kwargs = human_uttr_attr.pop("lm_service_kwargs", None) lm_service_kwargs = {} if lm_service_kwargs is None else lm_service_kwargs - envvars_to_send = ENVVARS_TO_SEND if len(ENVVARS_TO_SEND) else human_uttr_attributes.get("envvars_to_send", []) + envvars_to_send = ENVVARS_TO_SEND if len(ENVVARS_TO_SEND) else human_uttr_attr.get("envvars_to_send", []) sending_variables = compose_sending_variables( lm_service_kwargs, envvars_to_send, - **human_uttr_attributes, + **human_uttr_attr, ) response = send_request_to_prompted_generative_service( "", # нужен ли нам контекст и какой длины? @@ -71,13 +69,16 @@ def respond(): if 'no' in result.lower(): is_hyp_correct = False if is_hyp_correct: + logger.info(f"Internal hypothesis `{hyp_text}` correct according to external services.") results += ["Correct"] else: + logger.info(f"Internal hypothesis `{hyp_text}` incorrect according to external services.") results += ["Incorrect"] - except Exception as e: - logger.error(e) - results.append(["Correct"] * len(hypotheses)) + except Exception as e: + logger.error(e) + results += ["Correct"] return jsonify([{"batch": results}]) + if __name__ == "__main__": app.run(debug=False, host="0.0.0.0", port=3000) diff --git a/assistant_dists/dream/docker-compose.override.yml b/assistant_dists/dream/docker-compose.override.yml index 4b181f7dfc..7ead339fc5 100644 --- a/assistant_dists/dream/docker-compose.override.yml +++ b/assistant_dists/dream/docker-compose.override.yml @@ -486,7 +486,7 @@ services: memory: 4G fact-checking: - env_file: [ .env ] + env_file: [ .env, .env_secret ] build: args: GENERATIVE_SERVICE_URL: http://openai-api-chatgpt:8145/respond From 16d6f20549613306ab2a4680d99773635bc5b7d1 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Mon, 14 Aug 2023 20:19:20 +0300 Subject: [PATCH 04/35] fact-checking annotator, working version --- annotators/fact_checking/Dockerfile | 4 + annotators/fact_checking/server.py | 76 +++++++++++-------- .../dream/docker-compose.override.yml | 2 + 3 files changed, 49 insertions(+), 33 deletions(-) diff --git a/annotators/fact_checking/Dockerfile b/annotators/fact_checking/Dockerfile index 535c906cab..6d243d41e6 100644 --- a/annotators/fact_checking/Dockerfile +++ b/annotators/fact_checking/Dockerfile @@ -10,6 +10,10 @@ ARG GENERATIVE_TIMEOUT ENV GENERATIVE_TIMEOUT ${GENERATIVE_TIMEOUT} ARG GENERATIVE_SERVICE_CONFIG ENV GENERATIVE_SERVICE_CONFIG ${GENERATIVE_SERVICE_CONFIG} +ARG EXTERNAL_SKILLS +ENV EXTERNAL_SKILLS ${EXTERNAL_SKILLS} +ARG ENVVARS_TO_SEND +ENV ENVVARS_TO_SEND ${ENVVARS_TO_SEND} COPY annotators/fact_checking /src COPY common /src/common diff --git a/annotators/fact_checking/server.py b/annotators/fact_checking/server.py index 92edd1504f..f29da4dca0 100644 --- a/annotators/fact_checking/server.py +++ b/annotators/fact_checking/server.py @@ -13,9 +13,10 @@ sentry_sdk.init(dsn=getenv("SENTRY_DSN"), integrations=[FlaskIntegration()]) app = Flask(__name__) -EXTERNAL_SKILLS = ["factoid_qa", "dff_google_api_skill"] ENVVARS_TO_SEND = getenv("ENVVARS_TO_SEND", None) ENVVARS_TO_SEND = [] if ENVVARS_TO_SEND is None else ENVVARS_TO_SEND.split(",") +EXTERNAL_SKILLS = getenv("EXTERNAL_SKILLS", None) +EXTERNAL_SKILLS = [] if EXTERNAL_SKILLS is None else EXTERNAL_SKILLS.split(",") GENERATIVE_SERVICE_URL = getenv("GENERATIVE_SERVICE_URL") GENERATIVE_TIMEOUT = int(getenv("GENERATIVE_TIMEOUT", 0)) GENERATIVE_SERVICE_CONFIG = getenv("GENERATIVE_SERVICE_CONFIG") @@ -24,55 +25,64 @@ GENERATIVE_SERVICE_CONFIG = json.load(f) +def check_hyp_with_llm(curr_prompt, human_uttr_attr): + lm_service_kwargs = human_uttr_attr.pop("lm_service_kwargs", None) + lm_service_kwargs = {} if lm_service_kwargs is None else lm_service_kwargs + envvars_to_send = ENVVARS_TO_SEND if len(ENVVARS_TO_SEND) else human_uttr_attr.get("envvars_to_send", []) + sending_variables = compose_sending_variables( + lm_service_kwargs, + envvars_to_send, + **human_uttr_attr, + ) + response = send_request_to_prompted_generative_service( + "", # нужен ли нам контекст и какой длины? + curr_prompt, + GENERATIVE_SERVICE_URL, + GENERATIVE_SERVICE_CONFIG, + GENERATIVE_TIMEOUT, + sending_variables, + ) + result = response[0] + logger.info(f"llm response: `{result}`") + if 'yes' in result.lower(): + _is_hyp_correct = False + else: + _is_hyp_correct = True + return _is_hyp_correct + + @app.route("/respond", methods=["POST"]) def respond(): hypotheses = request.json["hypotheses"] human_uttr_attributes = request.json["human_uttr_attributes"] ie_types = ["external" if hyp["skill_name"] in EXTERNAL_SKILLS else "internal" for hyp in hypotheses] - external_service_hyps = [hyp["text"] for hyp in hypotheses if hyp["skill_name"] in EXTERNAL_SKILLS] # considered correct (always) + external_service_hyps = [(hyp["text"], hyp["skill_name"]) for hyp in hypotheses if hyp["skill_name"] in EXTERNAL_SKILLS] # considered correct (always) results = [] for hyp, human_uttr_attr, ie_type in zip(hypotheses, human_uttr_attributes, ie_types): hyp_text = hyp["text"] try: if ie_type == "external": - logger.info(f"Hypothesis `{hyp_text}` is external so it is deemed correct.") + logger.info(f"Hypothesis `{hyp_text}` is considered correct as it is external.") results += ["Correct"] else: if len(external_service_hyps) == 0: # there are no external hyps to check upon - logger.info(f"Hypothesis {hyp_text} is is deemed correct because there are no external hypothesis to check it upon.") + logger.info(f"Hypothesis `{hyp_text}` is considered correct as there are no external hypotheses to check it upon.") results += ["Correct"] else: - is_hyp_correct = True - for external_service_hyp in external_service_hyps: - curr_prompt = f'''Fact: `{external_service_hyp}` -Hypothesis: `{hyp_text}` -Does Hypothesis contain any information that contradicts Fact? Always answer only Yes or No.''' - logger.info(f"Sending prompt to llm to fact-check:\n`{curr_prompt}`") - lm_service_kwargs = human_uttr_attr.pop("lm_service_kwargs", None) - lm_service_kwargs = {} if lm_service_kwargs is None else lm_service_kwargs - envvars_to_send = ENVVARS_TO_SEND if len(ENVVARS_TO_SEND) else human_uttr_attr.get("envvars_to_send", []) - sending_variables = compose_sending_variables( - lm_service_kwargs, - envvars_to_send, - **human_uttr_attr, - ) - response = send_request_to_prompted_generative_service( - "", # нужен ли нам контекст и какой длины? - curr_prompt, - GENERATIVE_SERVICE_URL, - GENERATIVE_SERVICE_CONFIG, - GENERATIVE_TIMEOUT, - sending_variables, - ) - result = response[0] - logger.info(f"llm response: `{result}`") - if 'no' in result.lower(): - is_hyp_correct = False - if is_hyp_correct: - logger.info(f"Internal hypothesis `{hyp_text}` correct according to external services.") + _is_hyp_correct = True + for external_service_hyp, external_service_name in external_service_hyps: + curr_prompt = f'''Hypothesis: "{hyp_text}" +Does Hypothesis contradict Fact that {external_service_hyp}? Always answer only Yes or No without explanation.''' + logger.info(f"Prompt sent to LLM by fact-checking:\n`{curr_prompt}`") + _is_hyp_correct_one_step = check_hyp_with_llm(curr_prompt, human_uttr_attr) + if not _is_hyp_correct_one_step: + _is_hyp_correct = False + logger.info(f"""Internal hypothesis `{hyp_text}` is incorrect according to external service \ +{external_service_name}.""") + if _is_hyp_correct: + logger.info(f"Internal hypothesis `{hyp_text}` is correct according to all external services.") results += ["Correct"] else: - logger.info(f"Internal hypothesis `{hyp_text}` incorrect according to external services.") results += ["Incorrect"] except Exception as e: logger.error(e) diff --git a/assistant_dists/dream/docker-compose.override.yml b/assistant_dists/dream/docker-compose.override.yml index 7ead339fc5..a05b41e412 100644 --- a/assistant_dists/dream/docker-compose.override.yml +++ b/assistant_dists/dream/docker-compose.override.yml @@ -492,6 +492,8 @@ services: GENERATIVE_SERVICE_URL: http://openai-api-chatgpt:8145/respond GENERATIVE_TIMEOUT: 10 GENERATIVE_SERVICE_CONFIG: openai-chatgpt.json + ENVVARS_TO_SEND: OPENAI_API_KEY,OPENAI_ORGANIZATION + EXTERNAL_SKILLS: factoid_qa,dff_google_api_skill context: . dockerfile: annotators/fact_checking/Dockerfile command: flask run -h 0.0.0.0 -p 8182 From 82f98a2d4b15dc417dbdd85e5b4170465f53631f Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Mon, 14 Aug 2023 20:23:08 +0300 Subject: [PATCH 05/35] hyp considered incorrect after first contradiction --- annotators/fact_checking/server.py | 8 +- test_cand_ann.json | 4748 ---------------------------- 2 files changed, 4 insertions(+), 4752 deletions(-) delete mode 100644 test_cand_ann.json diff --git a/annotators/fact_checking/server.py b/annotators/fact_checking/server.py index f29da4dca0..cda802f22d 100644 --- a/annotators/fact_checking/server.py +++ b/annotators/fact_checking/server.py @@ -56,7 +56,7 @@ def respond(): hypotheses = request.json["hypotheses"] human_uttr_attributes = request.json["human_uttr_attributes"] ie_types = ["external" if hyp["skill_name"] in EXTERNAL_SKILLS else "internal" for hyp in hypotheses] - external_service_hyps = [(hyp["text"], hyp["skill_name"]) for hyp in hypotheses if hyp["skill_name"] in EXTERNAL_SKILLS] # considered correct (always) + external_service_hyps = [(hyp["text"], hyp["skill_name"]) for hyp in hypotheses if hyp["skill_name"] in EXTERNAL_SKILLS] results = [] for hyp, human_uttr_attr, ie_type in zip(hypotheses, human_uttr_attributes, ie_types): hyp_text = hyp["text"] @@ -65,7 +65,7 @@ def respond(): logger.info(f"Hypothesis `{hyp_text}` is considered correct as it is external.") results += ["Correct"] else: - if len(external_service_hyps) == 0: # there are no external hyps to check upon + if len(external_service_hyps) == 0: logger.info(f"Hypothesis `{hyp_text}` is considered correct as there are no external hypotheses to check it upon.") results += ["Correct"] else: @@ -79,11 +79,11 @@ def respond(): _is_hyp_correct = False logger.info(f"""Internal hypothesis `{hyp_text}` is incorrect according to external service \ {external_service_name}.""") + results += ["Incorrect"] + break if _is_hyp_correct: logger.info(f"Internal hypothesis `{hyp_text}` is correct according to all external services.") results += ["Correct"] - else: - results += ["Incorrect"] except Exception as e: logger.error(e) results += ["Correct"] diff --git a/test_cand_ann.json b/test_cand_ann.json deleted file mode 100644 index eb419a1658..0000000000 --- a/test_cand_ann.json +++ /dev/null @@ -1,4748 +0,0 @@ -{ - "_id": "64d4b9095c75901b774c6e54", - "dialog_id": "ccb940225c37d09c654e83448d85b9d4", - "utterances": [ - { - "utt_id": "62fe3760e03571d9203c72232b77582b", - "text": "hi", - "user": { - "id": "fbc32ff98e3a4b2d8a008247494a2553", - "user_external_id": "nfejviuewfiubfeiuvbwefioubuivwebofiboiuvw", - "persona": {}, - "profile": { - "name": null, - "gender": null, - "birthdate": null, - "location": null, - "home_coordinates": null, - "work_coordinates": null, - "occupation": null, - "income_per_year": null - }, - "attributes": { - "prompts_goals": {}, - "age_group": "", - "dff_dream_persona_prompted_skill_state": { - "context": { - "actor_state": {}, - "id": "320d6186-8994-4895-95fc-36a4490e2cc3", - "labels": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "misc": {}, - "requests": { - "0": "hi." - }, - "responses": { - "0": [ - [ - "Hello! It's lovely to meet you. How can I assist you today?", - 0.9, - {}, - {}, - { - "can_continue": "no" - } - ] - ] - }, - "validation": false - }, - "current_turn_dff_suspended": false, - "history": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "previous_human_utter_index": 0, - "shared_memory": {} - }, - "dff_shared_state": { - "cross_links": {}, - "cross_states": {} - }, - "disliked_skills": {}, - "used_links": {} - }, - "user_type": "human" - }, - "annotations": { - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.0, - "General_ChatIntent": 1.0, - "Information_DeliveryIntent": 0.0, - "Information_RequestIntent": 0.0, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.0, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.0, - "Topic_SwitchIntent": 0.0, - "User_InstructionIntent": 0.0 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.0, - "Entertainment_General": 0.0, - "Entertainment_Movies": 0.0, - "Entertainment_Music": 0.0, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 1.0, - "Politics": 0.0, - "Science_and_Technology": 0.0, - "Sports": 0.0 - }, - "cobot_topics": { - "Art_Event": 0.01, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.0, - "Literature": 0.0, - "Math": 0.0, - "Movies_TV": 0.01, - "Music": 0.0, - "News": 0.0, - "Other": 0.14, - "Pets_Animals": 0.02, - "Phatic": 0.0, - "Politics": 0.0, - "Psychology": 0.01, - "Religion": 0.0, - "SciTech": 0.12, - "Sex_Profanity": 0.0, - "Sports": 0.02, - "Travel_Geo": 0.32, - "Weather_Time": 0.35 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.02, - "Art&Hobbies": 0.01, - "ArtificialIntelligence": 0.01, - "Beauty": 0.04, - "Books&Literature": 0.0, - "Celebrities&Events": 0.01, - "Clothes": 0.02, - "Depression": 0.08, - "Disasters": 0.21, - "Education": 0.01, - "Family&Relationships": 0.02, - "Finance": 0.06, - "Food": 0.01, - "Gadgets": 0.02, - "Garden": 0.03, - "Health&Medicine": 0.02, - "Home&Design": 0.04, - "Job": 0.06, - "Leisure": 0.08, - "MassTransit": 0.02, - "Movies&Tv": 0.0, - "Music": 0.01, - "News": 0.02, - "PersonalTransport": 0.02, - "Politics": 0.01, - "Psychology": 0.01, - "Religion": 0.01, - "Science&Technology": 0.02, - "Space": 0.05, - "Sports": 0.02, - "Toys&Games": 0.01, - "Travel": 0.04, - "Videogames": 0.02 - }, - "emotion_classification": { - "anger": 0.01, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.25, - "neutral": 0.69, - "sadness": 0.02, - "surprise": 0.02 - }, - "factoid_classification": { - "is_conversational": 0.23, - "is_factoid": 0.77 - }, - "midas_classification": { - "appreciation": 0.01, - "clarifying_question": 0.0, - "command": 0.01, - "comment": 0.02, - "complaint": 0.03, - "dev_command": 0.01, - "neg_answer": 0.01, - "open_question_factual": 0.03, - "open_question_opinion": 0.0, - "open_question_personal": 0.0, - "opinion": 0.08, - "other_answers": 0.0, - "pos_answer": 0.01, - "statement": 0.79, - "yes_no_question": 0.01 - }, - "sentiment_classification": { - "negative": 0.09, - "neutral": 0.82, - "positive": 0.09 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.01, - "not_toxic": 0.98, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.01 - } - }, - "sentseg": { - "punct_sent": "hi.", - "segments": [ - "hi." - ] - }, - "prompt_selector": { - "max_similarity": 0.24786385893821716, - "prompts": [ - "dream_persona", - "dream_faq", - "dream_faq" - ] - }, - "ner": [ - [] - ], - "intent_catcher": { - "cant_do": { - "confidence": 0.0, - "detected": 0 - }, - "choose_topic": { - "confidence": 0.0, - "detected": 0 - }, - "doing_well": { - "confidence": 0.0, - "detected": 0 - }, - "dont_understand": { - "confidence": 0.0, - "detected": 0 - }, - "exit": { - "confidence": 0.0, - "detected": 0 - }, - "lets_chat_about": { - "confidence": 0.0, - "detected": 0 - }, - "no": { - "confidence": 0.0, - "detected": 0 - }, - "opinion_request": { - "confidence": 0.0, - "detected": 0 - }, - "repeat": { - "confidence": 0.0, - "detected": 0 - }, - "stupid": { - "confidence": 0.0, - "detected": 0 - }, - "tell_me_a_story": { - "confidence": 0.0, - "detected": 0 - }, - "tell_me_more": { - "confidence": 0.0, - "detected": 0 - }, - "topic_switching": { - "confidence": 0.0, - "detected": 0 - }, - "weather_forecast_intent": { - "confidence": 0.0, - "detected": 0 - }, - "what_are_you_talking_about": { - "confidence": 0.0, - "detected": 0 - }, - "what_can_you_do": { - "confidence": 0.0, - "detected": 0 - }, - "what_is_your_job": { - "confidence": 0.0, - "detected": 0 - }, - "what_is_your_name": { - "confidence": 0.0, - "detected": 0 - }, - "what_time": { - "confidence": 0.0, - "detected": 0 - }, - "where_are_you_from": { - "confidence": 0.0, - "detected": 0 - }, - "who_made_you": { - "confidence": 0.0, - "detected": 0 - }, - "yes": { - "confidence": 0.0, - "detected": 0 - } - }, - "entity_detection": {}, - "entity_linking": [], - "fact_retrieval": { - "facts": [], - "topic_facts": [] - }, - "wiki_parser": { - "animals_skill_entities_info": {}, - "entities_info": {}, - "topic_skill_entities_info": {}, - "utt_num": 1, - "wiki_skill_entities_info": {} - }, - "kbqa": { - "answer": "", - "confidence": 0.0, - "qa_system": "kbqa" - } - }, - "hypotheses": [ - { - "skill_name": "dummy_skill", - "annotations": { - "sentence_ranker": 0.2946605086326599, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.12, - "General_ChatIntent": 0.02, - "Information_DeliveryIntent": 0.01, - "Information_RequestIntent": 0.76, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.01, - "Opinion_ExpressionIntent": 0.02, - "Opinion_RequestIntent": 0.02, - "OtherIntent": 0.01, - "Topic_SwitchIntent": 0.03, - "User_InstructionIntent": 0.0 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.02, - "Entertainment_General": 0.01, - "Entertainment_Movies": 0.19, - "Entertainment_Music": 0.23, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.05, - "Politics": 0.01, - "Science_and_Technology": 0.45, - "Sports": 0.04 - }, - "cobot_topics": { - "Art_Event": 0.0, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.0, - "Literature": 0.0, - "Math": 0.0, - "Movies_TV": 0.01, - "Music": 0.01, - "News": 0.0, - "Other": 0.92, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.0, - "Psychology": 0.03, - "Religion": 0.01, - "SciTech": 0.01, - "Sex_Profanity": 0.0, - "Sports": 0.0, - "Travel_Geo": 0.0, - "Weather_Time": 0.0 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.01, - "Art&Hobbies": 0.01, - "ArtificialIntelligence": 0.03, - "Beauty": 0.01, - "Books&Literature": 0.0, - "Celebrities&Events": 0.01, - "Clothes": 0.02, - "Depression": 0.01, - "Disasters": 0.03, - "Education": 0.0, - "Family&Relationships": 0.01, - "Finance": 0.02, - "Food": 0.05, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.04, - "Home&Design": 0.01, - "Job": 0.09, - "Leisure": 0.03, - "MassTransit": 0.01, - "Movies&Tv": 0.06, - "Music": 0.07, - "News": 0.01, - "PersonalTransport": 0.0, - "Politics": 0.01, - "Psychology": 0.05, - "Religion": 0.02, - "Science&Technology": 0.04, - "Space": 0.26, - "Sports": 0.08, - "Toys&Games": 0.0, - "Travel": 0.01, - "Videogames": 0.0 - }, - "emotion_classification": { - "anger": 0.0, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.0, - "neutral": 0.0, - "sadness": 0.0, - "surprise": 0.99 - }, - "factoid_classification": { - "is_conversational": 0.75, - "is_factoid": 0.25 - }, - "midas_classification": { - "appreciation": 0.01, - "clarifying_question": 0.0, - "command": 0.13, - "comment": 0.0, - "complaint": 0.03, - "dev_command": 0.0, - "neg_answer": 0.0, - "open_question_factual": 0.33, - "open_question_opinion": 0.38, - "open_question_personal": 0.0, - "opinion": 0.01, - "other_answers": 0.02, - "pos_answer": 0.02, - "statement": 0.01, - "yes_no_question": 0.06 - }, - "sentiment_classification": { - "negative": 0.24, - "neutral": 0.68, - "positive": 0.07 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 0.99, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": {} - }, - "text": "I am a bit confused. What would you like to chat about?", - "confidence": 0.5, - "human_attributes": {}, - "bot_attributes": {}, - "type": "dummy" - }, - { - "skill_name": "dummy_skill", - "annotations": { - "sentence_ranker": 0.07921610027551651, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.01, - "General_ChatIntent": 0.02, - "Information_DeliveryIntent": 0.14, - "Information_RequestIntent": 0.75, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.01, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.0, - "Topic_SwitchIntent": 0.05, - "User_InstructionIntent": 0.01 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.0, - "Entertainment_General": 0.99, - "Entertainment_Movies": 0.0, - "Entertainment_Music": 0.0, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.0, - "Politics": 0.0, - "Science_and_Technology": 0.0, - "Sports": 0.0 - }, - "cobot_topics": { - "Art_Event": 0.0, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.09, - "Literature": 0.0, - "Math": 0.0, - "Movies_TV": 0.6, - "Music": 0.07, - "News": 0.0, - "Other": 0.04, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.01, - "Psychology": 0.02, - "Religion": 0.14, - "SciTech": 0.0, - "Sex_Profanity": 0.0, - "Sports": 0.01, - "Travel_Geo": 0.0, - "Weather_Time": 0.0 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.01, - "Beauty": 0.0, - "Books&Literature": 0.0, - "Celebrities&Events": 0.0, - "Clothes": 0.0, - "Depression": 0.01, - "Disasters": 0.0, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.0, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.0, - "Home&Design": 0.0, - "Job": 0.0, - "Leisure": 0.0, - "MassTransit": 0.0, - "Movies&Tv": 0.03, - "Music": 0.0, - "News": 0.01, - "PersonalTransport": 0.0, - "Politics": 0.01, - "Psychology": 0.02, - "Religion": 0.5, - "Science&Technology": 0.04, - "Space": 0.0, - "Sports": 0.0, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.34 - }, - "emotion_classification": { - "anger": 0.02, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.79, - "neutral": 0.1, - "sadness": 0.02, - "surprise": 0.07 - }, - "factoid_classification": { - "is_conversational": 0.72, - "is_factoid": 0.28 - }, - "midas_classification": { - "appreciation": 0.01, - "clarifying_question": 0.0, - "command": 0.64, - "comment": 0.01, - "complaint": 0.02, - "dev_command": 0.0, - "neg_answer": 0.01, - "open_question_factual": 0.01, - "open_question_opinion": 0.02, - "open_question_personal": 0.0, - "opinion": 0.13, - "other_answers": 0.01, - "pos_answer": 0.08, - "statement": 0.02, - "yes_no_question": 0.04 - }, - "sentiment_classification": { - "negative": 0.03, - "neutral": 0.85, - "positive": 0.12 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 0.99, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": { - "entities": [ - "video games", - "games", - "video games" - ], - "labelled_entities": [ - { - "finegrained_label": [ - [ - "misc", - 0.9953 - ] - ], - "label": "misc", - "offsets": [ - 51, - 62 - ], - "text": "video games" - }, - { - "finegrained_label": [ - [ - "misc", - 0.9979 - ] - ], - "label": "misc", - "offsets": [ - 144, - 149 - ], - "text": "games" - }, - { - "finegrained_label": [ - [ - "misc", - 0.9964 - ] - ], - "label": "misc", - "offsets": [ - 163, - 174 - ], - "text": "video games" - } - ] - } - }, - "text": "I wanted to mention that, The obvious objective of video games is to entertain people by surprising them with new experiences. Let's talk about games, do you love video games?", - "confidence": 0.05, - "human_attributes": { - "used_links": { - "game_cooperative_skill": [ - "I wanted to mention that, The obvious objective of video games is to entertain people by surprising them with new experiences. Let's talk about games, do you love video games?" - ] - }, - "used_wiki_topics": [], - "disliked_skills": [], - "prelinkto_connections": [ - "The obvious objective of video games is to entertain people by surprising them with new experiences." - ] - }, - "bot_attributes": {}, - "type": "link_to_for_response_selector", - "response_parts": [ - "prompt" - ] - }, - { - "skill_name": "dff_dream_persona_prompted_skill", - "annotations": { - "sentence_ranker": 0.4212228059768677, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.06, - "General_ChatIntent": 0.74, - "Information_DeliveryIntent": 0.04, - "Information_RequestIntent": 0.08, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.0, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.06, - "Topic_SwitchIntent": 0.01, - "User_InstructionIntent": 0.01 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.01, - "Entertainment_General": 0.02, - "Entertainment_Movies": 0.02, - "Entertainment_Music": 0.07, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.82, - "Politics": 0.0, - "Science_and_Technology": 0.01, - "Sports": 0.06 - }, - "cobot_topics": { - "Art_Event": 0.01, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.0, - "Literature": 0.01, - "Math": 0.0, - "Movies_TV": 0.0, - "Music": 0.01, - "News": 0.0, - "Other": 0.43, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.01, - "Psychology": 0.01, - "Religion": 0.49, - "SciTech": 0.0, - "Sex_Profanity": 0.0, - "Sports": 0.02, - "Travel_Geo": 0.01, - "Weather_Time": 0.01 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.01, - "Beauty": 0.01, - "Books&Literature": 0.0, - "Celebrities&Events": 0.0, - "Clothes": 0.0, - "Depression": 0.0, - "Disasters": 0.09, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.01, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.02, - "Home&Design": 0.0, - "Job": 0.01, - "Leisure": 0.02, - "MassTransit": 0.0, - "Movies&Tv": 0.0, - "Music": 0.0, - "News": 0.01, - "PersonalTransport": 0.0, - "Politics": 0.0, - "Psychology": 0.0, - "Religion": 0.78, - "Science&Technology": 0.0, - "Space": 0.0, - "Sports": 0.01, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.0 - }, - "emotion_classification": { - "anger": 0.01, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.14, - "neutral": 0.22, - "sadness": 0.07, - "surprise": 0.56 - }, - "factoid_classification": { - "is_conversational": 0.49, - "is_factoid": 0.51 - }, - "midas_classification": { - "appreciation": 0.01, - "clarifying_question": 0.0, - "command": 0.34, - "comment": 0.01, - "complaint": 0.2, - "dev_command": 0.02, - "neg_answer": 0.01, - "open_question_factual": 0.06, - "open_question_opinion": 0.02, - "open_question_personal": 0.0, - "opinion": 0.09, - "other_answers": 0.01, - "pos_answer": 0.04, - "statement": 0.13, - "yes_no_question": 0.06 - }, - "sentiment_classification": { - "negative": 0.1, - "neutral": 0.63, - "positive": 0.27 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 1.0, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": {} - }, - "text": "Hello! It's lovely to meet you. How can I assist you today?", - "confidence": 0.9, - "human_attributes": { - "age_group": "", - "dff_dream_persona_prompted_skill_state": { - "context": { - "actor_state": {}, - "id": "320d6186-8994-4895-95fc-36a4490e2cc3", - "labels": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "misc": {}, - "requests": { - "0": "hi." - }, - "responses": { - "0": [ - [ - "Hello! It's lovely to meet you. How can I assist you today?", - 0.9, - {}, - {}, - { - "can_continue": "no" - } - ] - ] - }, - "validation": false - }, - "current_turn_dff_suspended": false, - "history": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "previous_human_utter_index": 0, - "shared_memory": {} - }, - "dff_shared_state": { - "cross_links": {}, - "cross_states": {} - }, - "disliked_skills": {}, - "prompts_goals": {}, - "used_links": {} - }, - "bot_attributes": {}, - "can_continue": "no", - "is_final_answer": "true" - }, - { - "skill_name": "dff_dream_faq_prompted_skill", - "annotations": { - "sentence_ranker": 0.4034996032714844, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.44, - "General_ChatIntent": 0.32, - "Information_DeliveryIntent": 0.1, - "Information_RequestIntent": 0.12, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.0, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.01, - "Topic_SwitchIntent": 0.0, - "User_InstructionIntent": 0.01 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.02, - "Entertainment_General": 0.03, - "Entertainment_Movies": 0.11, - "Entertainment_Music": 0.14, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.54, - "Politics": 0.0, - "Science_and_Technology": 0.02, - "Sports": 0.13 - }, - "cobot_topics": { - "Art_Event": 0.01, - "Celebrities": 0.01, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.0, - "Literature": 0.02, - "Math": 0.0, - "Movies_TV": 0.0, - "Music": 0.01, - "News": 0.0, - "Other": 0.5, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.01, - "Psychology": 0.01, - "Religion": 0.27, - "SciTech": 0.03, - "Sex_Profanity": 0.0, - "Sports": 0.07, - "Travel_Geo": 0.03, - "Weather_Time": 0.01 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.0, - "Beauty": 0.0, - "Books&Literature": 0.0, - "Celebrities&Events": 0.01, - "Clothes": 0.0, - "Depression": 0.0, - "Disasters": 0.87, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.0, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.01, - "Home&Design": 0.0, - "Job": 0.0, - "Leisure": 0.0, - "MassTransit": 0.0, - "Movies&Tv": 0.0, - "Music": 0.0, - "News": 0.01, - "PersonalTransport": 0.0, - "Politics": 0.0, - "Psychology": 0.0, - "Religion": 0.05, - "Science&Technology": 0.0, - "Space": 0.0, - "Sports": 0.01, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.0 - }, - "emotion_classification": { - "anger": 0.0, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.01, - "neutral": 0.25, - "sadness": 0.02, - "surprise": 0.73 - }, - "factoid_classification": { - "is_conversational": 0.28, - "is_factoid": 0.72 - }, - "midas_classification": { - "appreciation": 0.0, - "clarifying_question": 0.0, - "command": 0.14, - "comment": 0.0, - "complaint": 0.17, - "dev_command": 0.01, - "neg_answer": 0.01, - "open_question_factual": 0.34, - "open_question_opinion": 0.01, - "open_question_personal": 0.0, - "opinion": 0.11, - "other_answers": 0.01, - "pos_answer": 0.01, - "statement": 0.14, - "yes_no_question": 0.05 - }, - "sentiment_classification": { - "negative": 0.04, - "neutral": 0.93, - "positive": 0.03 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 1.0, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": {} - }, - "text": "Hello! How can I assist you today?", - "confidence": 0.9, - "human_attributes": { - "age_group": "", - "dff_dream_faq_prompted_skill_state": { - "context": { - "actor_state": {}, - "id": "a948e1fd-6356-4261-a356-ffdb0b555e10", - "labels": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "misc": {}, - "requests": { - "0": "hi." - }, - "responses": { - "0": [ - [ - "Hello! How can I assist you today?", - 0.9, - {}, - {}, - { - "can_continue": "no", - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - } - } - ] - ] - }, - "validation": false - }, - "current_turn_dff_suspended": false, - "history": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "previous_human_utter_index": 0, - "shared_memory": {} - }, - "dff_shared_state": { - "cross_links": {}, - "cross_states": {} - }, - "disliked_skills": {}, - "prompts_goals": {}, - "used_links": {} - }, - "bot_attributes": {}, - "can_continue": "no", - "is_final_answer": "true", - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - } - } - ], - "date_time": "2023-08-10 10:16:39.741000", - "attributes": {} - }, - { - "utt_id": "acdd897e1ae32fb2c160072221a207f1", - "text": "Hello! It's lovely to meet you. How can I assist you today?", - "orig_text": "Hello! It's lovely to meet you. How can I assist you today?", - "active_skill": "dff_dream_persona_prompted_skill", - "confidence": 0.9, - "annotations": { - "sentseg": { - "punct_sent": "Hello! It's lovely to meet you. How can I assist you today?", - "segments": [ - "Hello!", - "It's lovely to meet you.", - "How can I assist you today?" - ] - }, - "ner": [ - [ - { - "confidence": 1, - "end_pos": 1, - "start_pos": 0, - "text": "Hello", - "type": "CARDINAL" - } - ], - [], - [] - ] - }, - "date_time": "2023-08-10 10:16:41.788000", - "user": { - "id": "089e50bfc4fa483bb408d0264b8f6ef4", - "persona": {}, - "attributes": { - "summarized_dialog": "" - }, - "user_type": "bot" - }, - "attributes": { - "can_continue": "no", - "is_final_answer": "true" - } - }, - { - "utt_id": "fb601e129d46883a8b4aada85d8ec72b", - "text": "source /home/smilga/dream/venv/bin/activate", - "user": { - "id": "64d4b9095c75901b774c6e52", - "user_external_id": "nfejviuewfiubfeiuvbwefioubuivwebofiboiuvw", - "persona": {}, - "profile": { - "name": null, - "gender": null, - "birthdate": null, - "location": null, - "home_coordinates": null, - "work_coordinates": null, - "occupation": null, - "income_per_year": null - }, - "attributes": { - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - }, - "age_group": "", - "dff_dream_persona_prompted_skill_state": { - "context": { - "actor_state": {}, - "id": "320d6186-8994-4895-95fc-36a4490e2cc3", - "labels": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "misc": {}, - "requests": { - "0": "hi." - }, - "responses": { - "0": [ - [ - "Hello! It's lovely to meet you. How can I assist you today?", - 0.9, - {}, - {}, - { - "can_continue": "no" - } - ] - ] - }, - "validation": false - }, - "current_turn_dff_suspended": false, - "history": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "previous_human_utter_index": 0, - "shared_memory": {} - }, - "dff_shared_state": { - "cross_links": {}, - "cross_states": {} - }, - "disliked_skills": {}, - "used_links": {} - }, - "user_type": "human" - }, - "annotations": { - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.0, - "General_ChatIntent": 0.82, - "Information_DeliveryIntent": 0.14, - "Information_RequestIntent": 0.02, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.0, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.0, - "Topic_SwitchIntent": 0.0, - "User_InstructionIntent": 0.02 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.02, - "Entertainment_General": 0.6, - "Entertainment_Movies": 0.05, - "Entertainment_Music": 0.02, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.21, - "Politics": 0.0, - "Science_and_Technology": 0.04, - "Sports": 0.06 - }, - "cobot_topics": { - "Art_Event": 0.0, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.2, - "Literature": 0.01, - "Math": 0.01, - "Movies_TV": 0.05, - "Music": 0.02, - "News": 0.0, - "Other": 0.13, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.02, - "Psychology": 0.07, - "Religion": 0.01, - "SciTech": 0.42, - "Sex_Profanity": 0.0, - "Sports": 0.03, - "Travel_Geo": 0.02, - "Weather_Time": 0.01 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.0, - "Beauty": 0.0, - "Books&Literature": 0.0, - "Celebrities&Events": 0.0, - "Clothes": 0.0, - "Depression": 0.0, - "Disasters": 0.11, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.0, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.0, - "Home&Design": 0.0, - "Job": 0.01, - "Leisure": 0.0, - "MassTransit": 0.0, - "Movies&Tv": 0.0, - "Music": 0.0, - "News": 0.01, - "PersonalTransport": 0.0, - "Politics": 0.0, - "Psychology": 0.0, - "Religion": 0.01, - "Science&Technology": 0.02, - "Space": 0.02, - "Sports": 0.0, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.8 - }, - "emotion_classification": { - "anger": 0.0, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.01, - "neutral": 0.99, - "sadness": 0.0, - "surprise": 0.0 - }, - "factoid_classification": { - "is_conversational": 0.08, - "is_factoid": 0.92 - }, - "midas_classification": { - "appreciation": 0.0, - "clarifying_question": 0.0, - "command": 0.06, - "comment": 0.0, - "complaint": 0.0, - "dev_command": 0.02, - "neg_answer": 0.0, - "open_question_factual": 0.01, - "open_question_opinion": 0.0, - "open_question_personal": 0.0, - "opinion": 0.49, - "other_answers": 0.0, - "pos_answer": 0.0, - "statement": 0.41, - "yes_no_question": 0.0 - }, - "sentiment_classification": { - "negative": 0.01, - "neutral": 0.92, - "positive": 0.07 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 1.0, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "prompt_selector": { - "max_similarity": 0.2567436099052429, - "prompts": [ - "dream_persona", - "dream_faq" - ] - }, - "sentseg": { - "punct_sent": "source /home/smilga/dream/venv/bin/activate.", - "segments": [ - "source /home/smilga/dream/venv/bin/activate." - ] - }, - "ner": [ - [ - { - "confidence": 1, - "end_pos": 5, - "start_pos": 4, - "text": "smilga", - "type": "ORG" - } - ] - ], - "intent_catcher": { - "cant_do": { - "confidence": 0.0, - "detected": 0 - }, - "choose_topic": { - "confidence": 0.0, - "detected": 0 - }, - "doing_well": { - "confidence": 0.0, - "detected": 0 - }, - "dont_understand": { - "confidence": 0.0, - "detected": 0 - }, - "exit": { - "confidence": 0.0, - "detected": 0 - }, - "lets_chat_about": { - "confidence": 0.0, - "detected": 0 - }, - "no": { - "confidence": 0.0, - "detected": 0 - }, - "opinion_request": { - "confidence": 0.0, - "detected": 0 - }, - "repeat": { - "confidence": 0.0, - "detected": 0 - }, - "stupid": { - "confidence": 0.0, - "detected": 0 - }, - "tell_me_a_story": { - "confidence": 0.0, - "detected": 0 - }, - "tell_me_more": { - "confidence": 0.0, - "detected": 0 - }, - "topic_switching": { - "confidence": 0.0, - "detected": 0 - }, - "weather_forecast_intent": { - "confidence": 0.0, - "detected": 0 - }, - "what_are_you_talking_about": { - "confidence": 0.0, - "detected": 0 - }, - "what_can_you_do": { - "confidence": 0.0, - "detected": 0 - }, - "what_is_your_job": { - "confidence": 0.0, - "detected": 0 - }, - "what_is_your_name": { - "confidence": 0.0, - "detected": 0 - }, - "what_time": { - "confidence": 0.0, - "detected": 0 - }, - "where_are_you_from": { - "confidence": 0.0, - "detected": 0 - }, - "who_made_you": { - "confidence": 0.0, - "detected": 0 - }, - "yes": { - "confidence": 0.0, - "detected": 0 - } - }, - "entity_detection": {}, - "entity_linking": [], - "fact_retrieval": { - "facts": [], - "topic_facts": [] - }, - "kbqa": { - "answer": "", - "confidence": 0.0, - "qa_system": "kbqa" - }, - "wiki_parser": { - "animals_skill_entities_info": {}, - "entities_info": {}, - "topic_skill_entities_info": {}, - "utt_num": 2, - "wiki_skill_entities_info": {} - } - }, - "hypotheses": [ - { - "skill_name": "dummy_skill", - "annotations": { - "sentence_ranker": 0.04173866659402847, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.12, - "General_ChatIntent": 0.02, - "Information_DeliveryIntent": 0.01, - "Information_RequestIntent": 0.76, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.01, - "Opinion_ExpressionIntent": 0.02, - "Opinion_RequestIntent": 0.02, - "OtherIntent": 0.01, - "Topic_SwitchIntent": 0.03, - "User_InstructionIntent": 0.0 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.02, - "Entertainment_General": 0.01, - "Entertainment_Movies": 0.19, - "Entertainment_Music": 0.23, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.05, - "Politics": 0.01, - "Science_and_Technology": 0.45, - "Sports": 0.04 - }, - "cobot_topics": { - "Art_Event": 0.0, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.0, - "Literature": 0.0, - "Math": 0.0, - "Movies_TV": 0.01, - "Music": 0.01, - "News": 0.0, - "Other": 0.92, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.0, - "Psychology": 0.03, - "Religion": 0.01, - "SciTech": 0.01, - "Sex_Profanity": 0.0, - "Sports": 0.0, - "Travel_Geo": 0.0, - "Weather_Time": 0.0 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.01, - "Art&Hobbies": 0.01, - "ArtificialIntelligence": 0.03, - "Beauty": 0.01, - "Books&Literature": 0.0, - "Celebrities&Events": 0.01, - "Clothes": 0.02, - "Depression": 0.01, - "Disasters": 0.03, - "Education": 0.0, - "Family&Relationships": 0.01, - "Finance": 0.02, - "Food": 0.05, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.04, - "Home&Design": 0.01, - "Job": 0.09, - "Leisure": 0.03, - "MassTransit": 0.01, - "Movies&Tv": 0.06, - "Music": 0.07, - "News": 0.01, - "PersonalTransport": 0.0, - "Politics": 0.01, - "Psychology": 0.05, - "Religion": 0.02, - "Science&Technology": 0.04, - "Space": 0.26, - "Sports": 0.08, - "Toys&Games": 0.0, - "Travel": 0.01, - "Videogames": 0.0 - }, - "emotion_classification": { - "anger": 0.0, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.0, - "neutral": 0.0, - "sadness": 0.0, - "surprise": 0.99 - }, - "factoid_classification": { - "is_conversational": 0.75, - "is_factoid": 0.25 - }, - "midas_classification": { - "appreciation": 0.01, - "clarifying_question": 0.0, - "command": 0.13, - "comment": 0.0, - "complaint": 0.03, - "dev_command": 0.0, - "neg_answer": 0.0, - "open_question_factual": 0.33, - "open_question_opinion": 0.38, - "open_question_personal": 0.0, - "opinion": 0.01, - "other_answers": 0.02, - "pos_answer": 0.02, - "statement": 0.01, - "yes_no_question": 0.06 - }, - "sentiment_classification": { - "negative": 0.24, - "neutral": 0.68, - "positive": 0.07 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 0.99, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": {} - }, - "text": "I am a bit confused. What would you like to chat about?", - "confidence": 0.5, - "human_attributes": {}, - "bot_attributes": {}, - "type": "dummy" - }, - { - "skill_name": "dummy_skill", - "annotations": { - "sentence_ranker": -0.04437091201543808, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.02, - "General_ChatIntent": 0.18, - "Information_DeliveryIntent": 0.33, - "Information_RequestIntent": 0.13, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.01, - "Opinion_ExpressionIntent": 0.27, - "Opinion_RequestIntent": 0.01, - "OtherIntent": 0.02, - "Topic_SwitchIntent": 0.01, - "User_InstructionIntent": 0.03 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.07, - "Entertainment_General": 0.06, - "Entertainment_Movies": 0.06, - "Entertainment_Music": 0.67, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.01, - "Politics": 0.01, - "Science_and_Technology": 0.11, - "Sports": 0.01 - }, - "cobot_topics": { - "Art_Event": 0.0, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.0, - "Literature": 0.01, - "Math": 0.0, - "Movies_TV": 0.0, - "Music": 0.09, - "News": 0.0, - "Other": 0.0, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.0, - "Psychology": 0.85, - "Religion": 0.03, - "SciTech": 0.0, - "Sex_Profanity": 0.0, - "Sports": 0.0, - "Travel_Geo": 0.0, - "Weather_Time": 0.0 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.0, - "Beauty": 0.0, - "Books&Literature": 0.0, - "Celebrities&Events": 0.04, - "Clothes": 0.0, - "Depression": 0.01, - "Disasters": 0.0, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.0, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.0, - "Home&Design": 0.0, - "Job": 0.0, - "Leisure": 0.0, - "MassTransit": 0.0, - "Movies&Tv": 0.0, - "Music": 0.12, - "News": 0.02, - "PersonalTransport": 0.0, - "Politics": 0.0, - "Psychology": 0.43, - "Religion": 0.29, - "Science&Technology": 0.06, - "Space": 0.0, - "Sports": 0.0, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.0 - }, - "emotion_classification": { - "anger": 0.0, - "disgust": 0.0, - "fear": 0.01, - "joy": 0.92, - "neutral": 0.05, - "sadness": 0.01, - "surprise": 0.01 - }, - "factoid_classification": { - "is_conversational": 0.74, - "is_factoid": 0.26 - }, - "midas_classification": { - "appreciation": 0.05, - "clarifying_question": 0.0, - "command": 0.09, - "comment": 0.1, - "complaint": 0.01, - "dev_command": 0.02, - "neg_answer": 0.0, - "open_question_factual": 0.01, - "open_question_opinion": 0.02, - "open_question_personal": 0.0, - "opinion": 0.47, - "other_answers": 0.02, - "pos_answer": 0.12, - "statement": 0.05, - "yes_no_question": 0.03 - }, - "sentiment_classification": { - "negative": 0.09, - "neutral": 0.68, - "positive": 0.23 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 1.0, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": { - "entities": [ - "music", - "humanity", - "planet", - "music", - "music", - "band" - ], - "labelled_entities": [ - { - "finegrained_label": [ - [ - "misc", - 0.9971 - ] - ], - "label": "misc", - "offsets": [ - 34, - 39 - ], - "text": "music" - }, - { - "finegrained_label": [ - [ - "misc", - 0.9832 - ] - ], - "label": "misc", - "offsets": [ - 94, - 102 - ], - "text": "humanity" - }, - { - "finegrained_label": [ - [ - "misc", - 0.9887 - ] - ], - "label": "misc", - "offsets": [ - 157, - 163 - ], - "text": "planet" - }, - { - "finegrained_label": [ - [ - "misc", - 0.9974 - ] - ], - "label": "misc", - "offsets": [ - 191, - 196 - ], - "text": "music" - }, - { - "finegrained_label": [ - [ - "misc", - 0.9974 - ] - ], - "label": "misc", - "offsets": [ - 215, - 220 - ], - "text": "music" - }, - { - "finegrained_label": [ - [ - "misc", - 0.995 - ] - ], - "label": "misc", - "offsets": [ - 251, - 255 - ], - "text": "band" - } - ] - } - }, - "text": "I wanted to mention that, I think music in itself is healing. It's an explosive expression of humanity. It's something we are all touched by. No matter what planet we're from, everyone loves music. Let's talk about music, Who do you think is the best band ever?", - "confidence": 0.05, - "human_attributes": { - "used_links": { - "dff_music_skill": [ - "I wanted to mention that, I think music in itself is healing. It's an explosive expression of humanity. It's something we are all touched by. No matter what planet we're from, everyone loves music. Let's talk about music, Who do you think is the best band ever?" - ] - }, - "used_wiki_topics": [], - "disliked_skills": {}, - "prelinkto_connections": [ - "I think music in itself is healing. It's an explosive expression of humanity. It's something we are all touched by. No matter what planet we're from, everyone loves music." - ] - }, - "bot_attributes": {}, - "type": "link_to_for_response_selector", - "response_parts": [ - "prompt" - ] - }, - { - "skill_name": "dff_dream_faq_prompted_skill", - "annotations": { - "sentence_ranker": 0.4274880886077881, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.02, - "General_ChatIntent": 0.57, - "Information_DeliveryIntent": 0.26, - "Information_RequestIntent": 0.04, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.02, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.02, - "Topic_SwitchIntent": 0.04, - "User_InstructionIntent": 0.02 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.05, - "Entertainment_General": 0.1, - "Entertainment_Movies": 0.03, - "Entertainment_Music": 0.14, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.26, - "Politics": 0.01, - "Science_and_Technology": 0.4, - "Sports": 0.01 - }, - "cobot_topics": { - "Art_Event": 0.0, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.01, - "Games": 0.01, - "Literature": 0.01, - "Math": 0.02, - "Movies_TV": 0.0, - "Music": 0.05, - "News": 0.0, - "Other": 0.1, - "Pets_Animals": 0.03, - "Phatic": 0.0, - "Politics": 0.01, - "Psychology": 0.1, - "Religion": 0.0, - "SciTech": 0.6, - "Sex_Profanity": 0.01, - "Sports": 0.01, - "Travel_Geo": 0.0, - "Weather_Time": 0.04 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.04, - "Beauty": 0.0, - "Books&Literature": 0.0, - "Celebrities&Events": 0.0, - "Clothes": 0.0, - "Depression": 0.0, - "Disasters": 0.01, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.0, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.0, - "Home&Design": 0.0, - "Job": 0.9, - "Leisure": 0.0, - "MassTransit": 0.0, - "Movies&Tv": 0.0, - "Music": 0.0, - "News": 0.0, - "PersonalTransport": 0.0, - "Politics": 0.0, - "Psychology": 0.0, - "Religion": 0.0, - "Science&Technology": 0.02, - "Space": 0.01, - "Sports": 0.0, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.0 - }, - "emotion_classification": { - "anger": 0.31, - "disgust": 0.01, - "fear": 0.02, - "joy": 0.06, - "neutral": 0.41, - "sadness": 0.17, - "surprise": 0.03 - }, - "factoid_classification": { - "is_conversational": 0.06, - "is_factoid": 0.94 - }, - "midas_classification": { - "appreciation": 0.02, - "clarifying_question": 0.0, - "command": 0.15, - "comment": 0.03, - "complaint": 0.06, - "dev_command": 0.06, - "neg_answer": 0.02, - "open_question_factual": 0.05, - "open_question_opinion": 0.02, - "open_question_personal": 0.0, - "opinion": 0.25, - "other_answers": 0.03, - "pos_answer": 0.04, - "statement": 0.25, - "yes_no_question": 0.02 - }, - "sentiment_classification": { - "negative": 0.55, - "neutral": 0.44, - "positive": 0.01 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 0.99, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": { - "entities": [ - "software installations" - ], - "labelled_entities": [ - { - "finegrained_label": [ - [ - "misc", - 0.6953 - ] - ], - "label": "misc", - "offsets": [ - 70, - 92 - ], - "text": "software installations" - } - ] - } - }, - "text": "I'm sorry, but I'm unable to execute commands or assist with specific software installations. However, I'm here to answer any questions you may have about DeepPavlov Dream. Feel free to ask anything!", - "confidence": 0.9, - "human_attributes": { - "age_group": "", - "dff_dream_faq_prompted_skill_state": { - "context": { - "actor_state": {}, - "id": "cd7f9d3c-8a93-47af-9eb6-5b245565ff5c", - "labels": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "misc": {}, - "requests": { - "0": "source /home/smilga/dream/venv/bin/activate." - }, - "responses": { - "0": [ - [ - "I'm sorry, but I'm unable to execute commands or assist with specific software installations. However, I'm here to answer any questions you may have about DeepPavlov Dream. Feel free to ask anything!", - 0.9, - {}, - {}, - { - "can_continue": "no", - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - } - } - ] - ] - }, - "validation": false - }, - "current_turn_dff_suspended": false, - "history": { - "1": [ - "generation", - "generative_response_node" - ] - }, - "previous_human_utter_index": 1, - "shared_memory": {} - }, - "dff_shared_state": { - "cross_links": {}, - "cross_states": {} - }, - "disliked_skills": {}, - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - }, - "used_links": {} - }, - "bot_attributes": {}, - "can_continue": "no", - "is_final_answer": "true", - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - } - }, - { - "skill_name": "dff_dream_persona_prompted_skill", - "annotations": { - "sentence_ranker": 0.3869864344596863, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.01, - "General_ChatIntent": 0.36, - "Information_DeliveryIntent": 0.53, - "Information_RequestIntent": 0.02, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.01, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.01, - "Topic_SwitchIntent": 0.01, - "User_InstructionIntent": 0.03 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.02, - "Entertainment_General": 0.51, - "Entertainment_Movies": 0.06, - "Entertainment_Music": 0.07, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.06, - "Politics": 0.0, - "Science_and_Technology": 0.25, - "Sports": 0.02 - }, - "cobot_topics": { - "Art_Event": 0.01, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.02, - "Literature": 0.0, - "Math": 0.01, - "Movies_TV": 0.0, - "Music": 0.01, - "News": 0.0, - "Other": 0.02, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.0, - "Psychology": 0.02, - "Religion": 0.0, - "SciTech": 0.88, - "Sex_Profanity": 0.0, - "Sports": 0.0, - "Travel_Geo": 0.0, - "Weather_Time": 0.02 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.05, - "Beauty": 0.0, - "Books&Literature": 0.0, - "Celebrities&Events": 0.0, - "Clothes": 0.0, - "Depression": 0.0, - "Disasters": 0.07, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.0, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.0, - "Home&Design": 0.0, - "Job": 0.17, - "Leisure": 0.0, - "MassTransit": 0.0, - "Movies&Tv": 0.0, - "Music": 0.0, - "News": 0.0, - "PersonalTransport": 0.0, - "Politics": 0.0, - "Psychology": 0.0, - "Religion": 0.0, - "Science&Technology": 0.01, - "Space": 0.61, - "Sports": 0.0, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.08 - }, - "emotion_classification": { - "anger": 0.01, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.89, - "neutral": 0.04, - "sadness": 0.0, - "surprise": 0.05 - }, - "factoid_classification": { - "is_conversational": 0.04, - "is_factoid": 0.96 - }, - "midas_classification": { - "appreciation": 0.19, - "clarifying_question": 0.0, - "command": 0.05, - "comment": 0.05, - "complaint": 0.02, - "dev_command": 0.05, - "neg_answer": 0.01, - "open_question_factual": 0.03, - "open_question_opinion": 0.02, - "open_question_personal": 0.0, - "opinion": 0.15, - "other_answers": 0.02, - "pos_answer": 0.08, - "statement": 0.3, - "yes_no_question": 0.02 - }, - "sentiment_classification": { - "negative": 0.15, - "neutral": 0.33, - "positive": 0.52 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 0.98, - "obscene": 0.01, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.01 - } - }, - "entity_detection": { - "entities": [ - "virtual environment" - ], - "labelled_entities": [ - { - "finegrained_label": [ - [ - "misc", - 0.8303 - ] - ], - "label": "misc", - "offsets": [ - 42, - 61 - ], - "text": "virtual environment" - } - ] - } - }, - "text": "It seems like you're trying to activate a virtual environment! That command looks correct, but I'm unable to execute it myself as I am a chatbot. Is there anything else I can help you with?", - "confidence": 0.9, - "human_attributes": { - "age_group": "", - "dff_dream_persona_prompted_skill_state": { - "context": { - "actor_state": {}, - "id": "320d6186-8994-4895-95fc-36a4490e2cc3", - "labels": { - "0": [ - "generation", - "generative_response_node" - ], - "1": [ - "generation", - "generative_response_node" - ] - }, - "misc": {}, - "requests": { - "0": "hi.", - "1": "source /home/smilga/dream/venv/bin/activate." - }, - "responses": { - "0": [ - [ - "Hello! It's lovely to meet you. How can I assist you today?", - 0.9, - {}, - {}, - { - "can_continue": "no" - } - ] - ], - "1": [ - [ - "It seems like you're trying to activate a virtual environment! That command looks correct, but I'm unable to execute it myself as I am a chatbot. Is there anything else I can help you with?", - 0.9, - {}, - {}, - { - "can_continue": "no" - } - ] - ] - }, - "validation": false - }, - "current_turn_dff_suspended": false, - "history": { - "0": [ - "generation", - "generative_response_node" - ], - "1": [ - "generation", - "generative_response_node" - ] - }, - "previous_human_utter_index": 1, - "shared_memory": {} - }, - "dff_shared_state": { - "cross_links": {}, - "cross_states": {} - }, - "disliked_skills": {}, - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - }, - "used_links": {} - }, - "bot_attributes": {}, - "can_continue": "no", - "is_final_answer": "true" - } - ], - "date_time": "2023-08-10 12:10:35.006331", - "attributes": {} - } - ], - "human_utterances": [ - { - "utt_id": "62fe3760e03571d9203c72232b77582b", - "text": "hi", - "user": { - "id": "fbc32ff98e3a4b2d8a008247494a2553", - "user_external_id": "nfejviuewfiubfeiuvbwefioubuivwebofiboiuvw", - "persona": {}, - "profile": { - "name": null, - "gender": null, - "birthdate": null, - "location": null, - "home_coordinates": null, - "work_coordinates": null, - "occupation": null, - "income_per_year": null - }, - "attributes": { - "prompts_goals": {}, - "age_group": "", - "dff_dream_persona_prompted_skill_state": { - "context": { - "actor_state": {}, - "id": "320d6186-8994-4895-95fc-36a4490e2cc3", - "labels": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "misc": {}, - "requests": { - "0": "hi." - }, - "responses": { - "0": [ - [ - "Hello! It's lovely to meet you. How can I assist you today?", - 0.9, - {}, - {}, - { - "can_continue": "no" - } - ] - ] - }, - "validation": false - }, - "current_turn_dff_suspended": false, - "history": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "previous_human_utter_index": 0, - "shared_memory": {} - }, - "dff_shared_state": { - "cross_links": {}, - "cross_states": {} - }, - "disliked_skills": {}, - "used_links": {} - }, - "user_type": "human" - }, - "annotations": { - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.0, - "General_ChatIntent": 1.0, - "Information_DeliveryIntent": 0.0, - "Information_RequestIntent": 0.0, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.0, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.0, - "Topic_SwitchIntent": 0.0, - "User_InstructionIntent": 0.0 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.0, - "Entertainment_General": 0.0, - "Entertainment_Movies": 0.0, - "Entertainment_Music": 0.0, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 1.0, - "Politics": 0.0, - "Science_and_Technology": 0.0, - "Sports": 0.0 - }, - "cobot_topics": { - "Art_Event": 0.01, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.0, - "Literature": 0.0, - "Math": 0.0, - "Movies_TV": 0.01, - "Music": 0.0, - "News": 0.0, - "Other": 0.14, - "Pets_Animals": 0.02, - "Phatic": 0.0, - "Politics": 0.0, - "Psychology": 0.01, - "Religion": 0.0, - "SciTech": 0.12, - "Sex_Profanity": 0.0, - "Sports": 0.02, - "Travel_Geo": 0.32, - "Weather_Time": 0.35 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.02, - "Art&Hobbies": 0.01, - "ArtificialIntelligence": 0.01, - "Beauty": 0.04, - "Books&Literature": 0.0, - "Celebrities&Events": 0.01, - "Clothes": 0.02, - "Depression": 0.08, - "Disasters": 0.21, - "Education": 0.01, - "Family&Relationships": 0.02, - "Finance": 0.06, - "Food": 0.01, - "Gadgets": 0.02, - "Garden": 0.03, - "Health&Medicine": 0.02, - "Home&Design": 0.04, - "Job": 0.06, - "Leisure": 0.08, - "MassTransit": 0.02, - "Movies&Tv": 0.0, - "Music": 0.01, - "News": 0.02, - "PersonalTransport": 0.02, - "Politics": 0.01, - "Psychology": 0.01, - "Religion": 0.01, - "Science&Technology": 0.02, - "Space": 0.05, - "Sports": 0.02, - "Toys&Games": 0.01, - "Travel": 0.04, - "Videogames": 0.02 - }, - "emotion_classification": { - "anger": 0.01, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.25, - "neutral": 0.69, - "sadness": 0.02, - "surprise": 0.02 - }, - "factoid_classification": { - "is_conversational": 0.23, - "is_factoid": 0.77 - }, - "midas_classification": { - "appreciation": 0.01, - "clarifying_question": 0.0, - "command": 0.01, - "comment": 0.02, - "complaint": 0.03, - "dev_command": 0.01, - "neg_answer": 0.01, - "open_question_factual": 0.03, - "open_question_opinion": 0.0, - "open_question_personal": 0.0, - "opinion": 0.08, - "other_answers": 0.0, - "pos_answer": 0.01, - "statement": 0.79, - "yes_no_question": 0.01 - }, - "sentiment_classification": { - "negative": 0.09, - "neutral": 0.82, - "positive": 0.09 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.01, - "not_toxic": 0.98, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.01 - } - }, - "sentseg": { - "punct_sent": "hi.", - "segments": [ - "hi." - ] - }, - "prompt_selector": { - "max_similarity": 0.24786385893821716, - "prompts": [ - "dream_persona", - "dream_faq", - "dream_faq" - ] - }, - "ner": [ - [] - ], - "intent_catcher": { - "cant_do": { - "confidence": 0.0, - "detected": 0 - }, - "choose_topic": { - "confidence": 0.0, - "detected": 0 - }, - "doing_well": { - "confidence": 0.0, - "detected": 0 - }, - "dont_understand": { - "confidence": 0.0, - "detected": 0 - }, - "exit": { - "confidence": 0.0, - "detected": 0 - }, - "lets_chat_about": { - "confidence": 0.0, - "detected": 0 - }, - "no": { - "confidence": 0.0, - "detected": 0 - }, - "opinion_request": { - "confidence": 0.0, - "detected": 0 - }, - "repeat": { - "confidence": 0.0, - "detected": 0 - }, - "stupid": { - "confidence": 0.0, - "detected": 0 - }, - "tell_me_a_story": { - "confidence": 0.0, - "detected": 0 - }, - "tell_me_more": { - "confidence": 0.0, - "detected": 0 - }, - "topic_switching": { - "confidence": 0.0, - "detected": 0 - }, - "weather_forecast_intent": { - "confidence": 0.0, - "detected": 0 - }, - "what_are_you_talking_about": { - "confidence": 0.0, - "detected": 0 - }, - "what_can_you_do": { - "confidence": 0.0, - "detected": 0 - }, - "what_is_your_job": { - "confidence": 0.0, - "detected": 0 - }, - "what_is_your_name": { - "confidence": 0.0, - "detected": 0 - }, - "what_time": { - "confidence": 0.0, - "detected": 0 - }, - "where_are_you_from": { - "confidence": 0.0, - "detected": 0 - }, - "who_made_you": { - "confidence": 0.0, - "detected": 0 - }, - "yes": { - "confidence": 0.0, - "detected": 0 - } - }, - "entity_detection": {}, - "entity_linking": [], - "fact_retrieval": { - "facts": [], - "topic_facts": [] - }, - "wiki_parser": { - "animals_skill_entities_info": {}, - "entities_info": {}, - "topic_skill_entities_info": {}, - "utt_num": 1, - "wiki_skill_entities_info": {} - }, - "kbqa": { - "answer": "", - "confidence": 0.0, - "qa_system": "kbqa" - } - }, - "hypotheses": [ - { - "skill_name": "dummy_skill", - "annotations": { - "sentence_ranker": 0.2946605086326599, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.12, - "General_ChatIntent": 0.02, - "Information_DeliveryIntent": 0.01, - "Information_RequestIntent": 0.76, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.01, - "Opinion_ExpressionIntent": 0.02, - "Opinion_RequestIntent": 0.02, - "OtherIntent": 0.01, - "Topic_SwitchIntent": 0.03, - "User_InstructionIntent": 0.0 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.02, - "Entertainment_General": 0.01, - "Entertainment_Movies": 0.19, - "Entertainment_Music": 0.23, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.05, - "Politics": 0.01, - "Science_and_Technology": 0.45, - "Sports": 0.04 - }, - "cobot_topics": { - "Art_Event": 0.0, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.0, - "Literature": 0.0, - "Math": 0.0, - "Movies_TV": 0.01, - "Music": 0.01, - "News": 0.0, - "Other": 0.92, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.0, - "Psychology": 0.03, - "Religion": 0.01, - "SciTech": 0.01, - "Sex_Profanity": 0.0, - "Sports": 0.0, - "Travel_Geo": 0.0, - "Weather_Time": 0.0 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.01, - "Art&Hobbies": 0.01, - "ArtificialIntelligence": 0.03, - "Beauty": 0.01, - "Books&Literature": 0.0, - "Celebrities&Events": 0.01, - "Clothes": 0.02, - "Depression": 0.01, - "Disasters": 0.03, - "Education": 0.0, - "Family&Relationships": 0.01, - "Finance": 0.02, - "Food": 0.05, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.04, - "Home&Design": 0.01, - "Job": 0.09, - "Leisure": 0.03, - "MassTransit": 0.01, - "Movies&Tv": 0.06, - "Music": 0.07, - "News": 0.01, - "PersonalTransport": 0.0, - "Politics": 0.01, - "Psychology": 0.05, - "Religion": 0.02, - "Science&Technology": 0.04, - "Space": 0.26, - "Sports": 0.08, - "Toys&Games": 0.0, - "Travel": 0.01, - "Videogames": 0.0 - }, - "emotion_classification": { - "anger": 0.0, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.0, - "neutral": 0.0, - "sadness": 0.0, - "surprise": 0.99 - }, - "factoid_classification": { - "is_conversational": 0.75, - "is_factoid": 0.25 - }, - "midas_classification": { - "appreciation": 0.01, - "clarifying_question": 0.0, - "command": 0.13, - "comment": 0.0, - "complaint": 0.03, - "dev_command": 0.0, - "neg_answer": 0.0, - "open_question_factual": 0.33, - "open_question_opinion": 0.38, - "open_question_personal": 0.0, - "opinion": 0.01, - "other_answers": 0.02, - "pos_answer": 0.02, - "statement": 0.01, - "yes_no_question": 0.06 - }, - "sentiment_classification": { - "negative": 0.24, - "neutral": 0.68, - "positive": 0.07 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 0.99, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": {} - }, - "text": "I am a bit confused. What would you like to chat about?", - "confidence": 0.5, - "human_attributes": {}, - "bot_attributes": {}, - "type": "dummy" - }, - { - "skill_name": "dummy_skill", - "annotations": { - "sentence_ranker": 0.07921610027551651, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.01, - "General_ChatIntent": 0.02, - "Information_DeliveryIntent": 0.14, - "Information_RequestIntent": 0.75, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.01, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.0, - "Topic_SwitchIntent": 0.05, - "User_InstructionIntent": 0.01 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.0, - "Entertainment_General": 0.99, - "Entertainment_Movies": 0.0, - "Entertainment_Music": 0.0, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.0, - "Politics": 0.0, - "Science_and_Technology": 0.0, - "Sports": 0.0 - }, - "cobot_topics": { - "Art_Event": 0.0, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.09, - "Literature": 0.0, - "Math": 0.0, - "Movies_TV": 0.6, - "Music": 0.07, - "News": 0.0, - "Other": 0.04, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.01, - "Psychology": 0.02, - "Religion": 0.14, - "SciTech": 0.0, - "Sex_Profanity": 0.0, - "Sports": 0.01, - "Travel_Geo": 0.0, - "Weather_Time": 0.0 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.01, - "Beauty": 0.0, - "Books&Literature": 0.0, - "Celebrities&Events": 0.0, - "Clothes": 0.0, - "Depression": 0.01, - "Disasters": 0.0, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.0, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.0, - "Home&Design": 0.0, - "Job": 0.0, - "Leisure": 0.0, - "MassTransit": 0.0, - "Movies&Tv": 0.03, - "Music": 0.0, - "News": 0.01, - "PersonalTransport": 0.0, - "Politics": 0.01, - "Psychology": 0.02, - "Religion": 0.5, - "Science&Technology": 0.04, - "Space": 0.0, - "Sports": 0.0, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.34 - }, - "emotion_classification": { - "anger": 0.02, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.79, - "neutral": 0.1, - "sadness": 0.02, - "surprise": 0.07 - }, - "factoid_classification": { - "is_conversational": 0.72, - "is_factoid": 0.28 - }, - "midas_classification": { - "appreciation": 0.01, - "clarifying_question": 0.0, - "command": 0.64, - "comment": 0.01, - "complaint": 0.02, - "dev_command": 0.0, - "neg_answer": 0.01, - "open_question_factual": 0.01, - "open_question_opinion": 0.02, - "open_question_personal": 0.0, - "opinion": 0.13, - "other_answers": 0.01, - "pos_answer": 0.08, - "statement": 0.02, - "yes_no_question": 0.04 - }, - "sentiment_classification": { - "negative": 0.03, - "neutral": 0.85, - "positive": 0.12 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 0.99, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": { - "entities": [ - "video games", - "games", - "video games" - ], - "labelled_entities": [ - { - "finegrained_label": [ - [ - "misc", - 0.9953 - ] - ], - "label": "misc", - "offsets": [ - 51, - 62 - ], - "text": "video games" - }, - { - "finegrained_label": [ - [ - "misc", - 0.9979 - ] - ], - "label": "misc", - "offsets": [ - 144, - 149 - ], - "text": "games" - }, - { - "finegrained_label": [ - [ - "misc", - 0.9964 - ] - ], - "label": "misc", - "offsets": [ - 163, - 174 - ], - "text": "video games" - } - ] - } - }, - "text": "I wanted to mention that, The obvious objective of video games is to entertain people by surprising them with new experiences. Let's talk about games, do you love video games?", - "confidence": 0.05, - "human_attributes": { - "used_links": { - "game_cooperative_skill": [ - "I wanted to mention that, The obvious objective of video games is to entertain people by surprising them with new experiences. Let's talk about games, do you love video games?" - ] - }, - "used_wiki_topics": [], - "disliked_skills": [], - "prelinkto_connections": [ - "The obvious objective of video games is to entertain people by surprising them with new experiences." - ] - }, - "bot_attributes": {}, - "type": "link_to_for_response_selector", - "response_parts": [ - "prompt" - ] - }, - { - "skill_name": "dff_dream_persona_prompted_skill", - "annotations": { - "sentence_ranker": 0.4212228059768677, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.06, - "General_ChatIntent": 0.74, - "Information_DeliveryIntent": 0.04, - "Information_RequestIntent": 0.08, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.0, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.06, - "Topic_SwitchIntent": 0.01, - "User_InstructionIntent": 0.01 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.01, - "Entertainment_General": 0.02, - "Entertainment_Movies": 0.02, - "Entertainment_Music": 0.07, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.82, - "Politics": 0.0, - "Science_and_Technology": 0.01, - "Sports": 0.06 - }, - "cobot_topics": { - "Art_Event": 0.01, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.0, - "Literature": 0.01, - "Math": 0.0, - "Movies_TV": 0.0, - "Music": 0.01, - "News": 0.0, - "Other": 0.43, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.01, - "Psychology": 0.01, - "Religion": 0.49, - "SciTech": 0.0, - "Sex_Profanity": 0.0, - "Sports": 0.02, - "Travel_Geo": 0.01, - "Weather_Time": 0.01 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.01, - "Beauty": 0.01, - "Books&Literature": 0.0, - "Celebrities&Events": 0.0, - "Clothes": 0.0, - "Depression": 0.0, - "Disasters": 0.09, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.01, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.02, - "Home&Design": 0.0, - "Job": 0.01, - "Leisure": 0.02, - "MassTransit": 0.0, - "Movies&Tv": 0.0, - "Music": 0.0, - "News": 0.01, - "PersonalTransport": 0.0, - "Politics": 0.0, - "Psychology": 0.0, - "Religion": 0.78, - "Science&Technology": 0.0, - "Space": 0.0, - "Sports": 0.01, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.0 - }, - "emotion_classification": { - "anger": 0.01, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.14, - "neutral": 0.22, - "sadness": 0.07, - "surprise": 0.56 - }, - "factoid_classification": { - "is_conversational": 0.49, - "is_factoid": 0.51 - }, - "midas_classification": { - "appreciation": 0.01, - "clarifying_question": 0.0, - "command": 0.34, - "comment": 0.01, - "complaint": 0.2, - "dev_command": 0.02, - "neg_answer": 0.01, - "open_question_factual": 0.06, - "open_question_opinion": 0.02, - "open_question_personal": 0.0, - "opinion": 0.09, - "other_answers": 0.01, - "pos_answer": 0.04, - "statement": 0.13, - "yes_no_question": 0.06 - }, - "sentiment_classification": { - "negative": 0.1, - "neutral": 0.63, - "positive": 0.27 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 1.0, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": {} - }, - "text": "Hello! It's lovely to meet you. How can I assist you today?", - "confidence": 0.9, - "human_attributes": { - "age_group": "", - "dff_dream_persona_prompted_skill_state": { - "context": { - "actor_state": {}, - "id": "320d6186-8994-4895-95fc-36a4490e2cc3", - "labels": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "misc": {}, - "requests": { - "0": "hi." - }, - "responses": { - "0": [ - [ - "Hello! It's lovely to meet you. How can I assist you today?", - 0.9, - {}, - {}, - { - "can_continue": "no" - } - ] - ] - }, - "validation": false - }, - "current_turn_dff_suspended": false, - "history": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "previous_human_utter_index": 0, - "shared_memory": {} - }, - "dff_shared_state": { - "cross_links": {}, - "cross_states": {} - }, - "disliked_skills": {}, - "prompts_goals": {}, - "used_links": {} - }, - "bot_attributes": {}, - "can_continue": "no", - "is_final_answer": "true" - }, - { - "skill_name": "dff_dream_faq_prompted_skill", - "annotations": { - "sentence_ranker": 0.4034996032714844, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.44, - "General_ChatIntent": 0.32, - "Information_DeliveryIntent": 0.1, - "Information_RequestIntent": 0.12, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.0, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.01, - "Topic_SwitchIntent": 0.0, - "User_InstructionIntent": 0.01 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.02, - "Entertainment_General": 0.03, - "Entertainment_Movies": 0.11, - "Entertainment_Music": 0.14, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.54, - "Politics": 0.0, - "Science_and_Technology": 0.02, - "Sports": 0.13 - }, - "cobot_topics": { - "Art_Event": 0.01, - "Celebrities": 0.01, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.0, - "Literature": 0.02, - "Math": 0.0, - "Movies_TV": 0.0, - "Music": 0.01, - "News": 0.0, - "Other": 0.5, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.01, - "Psychology": 0.01, - "Religion": 0.27, - "SciTech": 0.03, - "Sex_Profanity": 0.0, - "Sports": 0.07, - "Travel_Geo": 0.03, - "Weather_Time": 0.01 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.0, - "Beauty": 0.0, - "Books&Literature": 0.0, - "Celebrities&Events": 0.01, - "Clothes": 0.0, - "Depression": 0.0, - "Disasters": 0.87, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.0, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.01, - "Home&Design": 0.0, - "Job": 0.0, - "Leisure": 0.0, - "MassTransit": 0.0, - "Movies&Tv": 0.0, - "Music": 0.0, - "News": 0.01, - "PersonalTransport": 0.0, - "Politics": 0.0, - "Psychology": 0.0, - "Religion": 0.05, - "Science&Technology": 0.0, - "Space": 0.0, - "Sports": 0.01, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.0 - }, - "emotion_classification": { - "anger": 0.0, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.01, - "neutral": 0.25, - "sadness": 0.02, - "surprise": 0.73 - }, - "factoid_classification": { - "is_conversational": 0.28, - "is_factoid": 0.72 - }, - "midas_classification": { - "appreciation": 0.0, - "clarifying_question": 0.0, - "command": 0.14, - "comment": 0.0, - "complaint": 0.17, - "dev_command": 0.01, - "neg_answer": 0.01, - "open_question_factual": 0.34, - "open_question_opinion": 0.01, - "open_question_personal": 0.0, - "opinion": 0.11, - "other_answers": 0.01, - "pos_answer": 0.01, - "statement": 0.14, - "yes_no_question": 0.05 - }, - "sentiment_classification": { - "negative": 0.04, - "neutral": 0.93, - "positive": 0.03 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 1.0, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": {} - }, - "text": "Hello! How can I assist you today?", - "confidence": 0.9, - "human_attributes": { - "age_group": "", - "dff_dream_faq_prompted_skill_state": { - "context": { - "actor_state": {}, - "id": "a948e1fd-6356-4261-a356-ffdb0b555e10", - "labels": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "misc": {}, - "requests": { - "0": "hi." - }, - "responses": { - "0": [ - [ - "Hello! How can I assist you today?", - 0.9, - {}, - {}, - { - "can_continue": "no", - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - } - } - ] - ] - }, - "validation": false - }, - "current_turn_dff_suspended": false, - "history": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "previous_human_utter_index": 0, - "shared_memory": {} - }, - "dff_shared_state": { - "cross_links": {}, - "cross_states": {} - }, - "disliked_skills": {}, - "prompts_goals": {}, - "used_links": {} - }, - "bot_attributes": {}, - "can_continue": "no", - "is_final_answer": "true", - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - } - } - ], - "date_time": "2023-08-10 10:16:39.741000", - "attributes": {} - }, - { - "utt_id": "fb601e129d46883a8b4aada85d8ec72b", - "text": "source /home/smilga/dream/venv/bin/activate", - "user": { - "id": "64d4b9095c75901b774c6e52", - "user_external_id": "nfejviuewfiubfeiuvbwefioubuivwebofiboiuvw", - "persona": {}, - "profile": { - "name": null, - "gender": null, - "birthdate": null, - "location": null, - "home_coordinates": null, - "work_coordinates": null, - "occupation": null, - "income_per_year": null - }, - "attributes": { - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - }, - "age_group": "", - "dff_dream_persona_prompted_skill_state": { - "context": { - "actor_state": {}, - "id": "320d6186-8994-4895-95fc-36a4490e2cc3", - "labels": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "misc": {}, - "requests": { - "0": "hi." - }, - "responses": { - "0": [ - [ - "Hello! It's lovely to meet you. How can I assist you today?", - 0.9, - {}, - {}, - { - "can_continue": "no" - } - ] - ] - }, - "validation": false - }, - "current_turn_dff_suspended": false, - "history": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "previous_human_utter_index": 0, - "shared_memory": {} - }, - "dff_shared_state": { - "cross_links": {}, - "cross_states": {} - }, - "disliked_skills": {}, - "used_links": {} - }, - "user_type": "human" - }, - "annotations": { - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.0, - "General_ChatIntent": 0.82, - "Information_DeliveryIntent": 0.14, - "Information_RequestIntent": 0.02, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.0, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.0, - "Topic_SwitchIntent": 0.0, - "User_InstructionIntent": 0.02 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.02, - "Entertainment_General": 0.6, - "Entertainment_Movies": 0.05, - "Entertainment_Music": 0.02, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.21, - "Politics": 0.0, - "Science_and_Technology": 0.04, - "Sports": 0.06 - }, - "cobot_topics": { - "Art_Event": 0.0, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.2, - "Literature": 0.01, - "Math": 0.01, - "Movies_TV": 0.05, - "Music": 0.02, - "News": 0.0, - "Other": 0.13, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.02, - "Psychology": 0.07, - "Religion": 0.01, - "SciTech": 0.42, - "Sex_Profanity": 0.0, - "Sports": 0.03, - "Travel_Geo": 0.02, - "Weather_Time": 0.01 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.0, - "Beauty": 0.0, - "Books&Literature": 0.0, - "Celebrities&Events": 0.0, - "Clothes": 0.0, - "Depression": 0.0, - "Disasters": 0.11, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.0, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.0, - "Home&Design": 0.0, - "Job": 0.01, - "Leisure": 0.0, - "MassTransit": 0.0, - "Movies&Tv": 0.0, - "Music": 0.0, - "News": 0.01, - "PersonalTransport": 0.0, - "Politics": 0.0, - "Psychology": 0.0, - "Religion": 0.01, - "Science&Technology": 0.02, - "Space": 0.02, - "Sports": 0.0, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.8 - }, - "emotion_classification": { - "anger": 0.0, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.01, - "neutral": 0.99, - "sadness": 0.0, - "surprise": 0.0 - }, - "factoid_classification": { - "is_conversational": 0.08, - "is_factoid": 0.92 - }, - "midas_classification": { - "appreciation": 0.0, - "clarifying_question": 0.0, - "command": 0.06, - "comment": 0.0, - "complaint": 0.0, - "dev_command": 0.02, - "neg_answer": 0.0, - "open_question_factual": 0.01, - "open_question_opinion": 0.0, - "open_question_personal": 0.0, - "opinion": 0.49, - "other_answers": 0.0, - "pos_answer": 0.0, - "statement": 0.41, - "yes_no_question": 0.0 - }, - "sentiment_classification": { - "negative": 0.01, - "neutral": 0.92, - "positive": 0.07 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 1.0, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "prompt_selector": { - "max_similarity": 0.2567436099052429, - "prompts": [ - "dream_persona", - "dream_faq" - ] - }, - "sentseg": { - "punct_sent": "source /home/smilga/dream/venv/bin/activate.", - "segments": [ - "source /home/smilga/dream/venv/bin/activate." - ] - }, - "ner": [ - [ - { - "confidence": 1, - "end_pos": 5, - "start_pos": 4, - "text": "smilga", - "type": "ORG" - } - ] - ], - "intent_catcher": { - "cant_do": { - "confidence": 0.0, - "detected": 0 - }, - "choose_topic": { - "confidence": 0.0, - "detected": 0 - }, - "doing_well": { - "confidence": 0.0, - "detected": 0 - }, - "dont_understand": { - "confidence": 0.0, - "detected": 0 - }, - "exit": { - "confidence": 0.0, - "detected": 0 - }, - "lets_chat_about": { - "confidence": 0.0, - "detected": 0 - }, - "no": { - "confidence": 0.0, - "detected": 0 - }, - "opinion_request": { - "confidence": 0.0, - "detected": 0 - }, - "repeat": { - "confidence": 0.0, - "detected": 0 - }, - "stupid": { - "confidence": 0.0, - "detected": 0 - }, - "tell_me_a_story": { - "confidence": 0.0, - "detected": 0 - }, - "tell_me_more": { - "confidence": 0.0, - "detected": 0 - }, - "topic_switching": { - "confidence": 0.0, - "detected": 0 - }, - "weather_forecast_intent": { - "confidence": 0.0, - "detected": 0 - }, - "what_are_you_talking_about": { - "confidence": 0.0, - "detected": 0 - }, - "what_can_you_do": { - "confidence": 0.0, - "detected": 0 - }, - "what_is_your_job": { - "confidence": 0.0, - "detected": 0 - }, - "what_is_your_name": { - "confidence": 0.0, - "detected": 0 - }, - "what_time": { - "confidence": 0.0, - "detected": 0 - }, - "where_are_you_from": { - "confidence": 0.0, - "detected": 0 - }, - "who_made_you": { - "confidence": 0.0, - "detected": 0 - }, - "yes": { - "confidence": 0.0, - "detected": 0 - } - }, - "entity_detection": {}, - "entity_linking": [], - "fact_retrieval": { - "facts": [], - "topic_facts": [] - }, - "kbqa": { - "answer": "", - "confidence": 0.0, - "qa_system": "kbqa" - }, - "wiki_parser": { - "animals_skill_entities_info": {}, - "entities_info": {}, - "topic_skill_entities_info": {}, - "utt_num": 2, - "wiki_skill_entities_info": {} - } - }, - "hypotheses": [ - { - "skill_name": "dummy_skill", - "annotations": { - "sentence_ranker": 0.04173866659402847, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.12, - "General_ChatIntent": 0.02, - "Information_DeliveryIntent": 0.01, - "Information_RequestIntent": 0.76, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.01, - "Opinion_ExpressionIntent": 0.02, - "Opinion_RequestIntent": 0.02, - "OtherIntent": 0.01, - "Topic_SwitchIntent": 0.03, - "User_InstructionIntent": 0.0 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.02, - "Entertainment_General": 0.01, - "Entertainment_Movies": 0.19, - "Entertainment_Music": 0.23, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.05, - "Politics": 0.01, - "Science_and_Technology": 0.45, - "Sports": 0.04 - }, - "cobot_topics": { - "Art_Event": 0.0, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.0, - "Literature": 0.0, - "Math": 0.0, - "Movies_TV": 0.01, - "Music": 0.01, - "News": 0.0, - "Other": 0.92, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.0, - "Psychology": 0.03, - "Religion": 0.01, - "SciTech": 0.01, - "Sex_Profanity": 0.0, - "Sports": 0.0, - "Travel_Geo": 0.0, - "Weather_Time": 0.0 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.01, - "Art&Hobbies": 0.01, - "ArtificialIntelligence": 0.03, - "Beauty": 0.01, - "Books&Literature": 0.0, - "Celebrities&Events": 0.01, - "Clothes": 0.02, - "Depression": 0.01, - "Disasters": 0.03, - "Education": 0.0, - "Family&Relationships": 0.01, - "Finance": 0.02, - "Food": 0.05, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.04, - "Home&Design": 0.01, - "Job": 0.09, - "Leisure": 0.03, - "MassTransit": 0.01, - "Movies&Tv": 0.06, - "Music": 0.07, - "News": 0.01, - "PersonalTransport": 0.0, - "Politics": 0.01, - "Psychology": 0.05, - "Religion": 0.02, - "Science&Technology": 0.04, - "Space": 0.26, - "Sports": 0.08, - "Toys&Games": 0.0, - "Travel": 0.01, - "Videogames": 0.0 - }, - "emotion_classification": { - "anger": 0.0, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.0, - "neutral": 0.0, - "sadness": 0.0, - "surprise": 0.99 - }, - "factoid_classification": { - "is_conversational": 0.75, - "is_factoid": 0.25 - }, - "midas_classification": { - "appreciation": 0.01, - "clarifying_question": 0.0, - "command": 0.13, - "comment": 0.0, - "complaint": 0.03, - "dev_command": 0.0, - "neg_answer": 0.0, - "open_question_factual": 0.33, - "open_question_opinion": 0.38, - "open_question_personal": 0.0, - "opinion": 0.01, - "other_answers": 0.02, - "pos_answer": 0.02, - "statement": 0.01, - "yes_no_question": 0.06 - }, - "sentiment_classification": { - "negative": 0.24, - "neutral": 0.68, - "positive": 0.07 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 0.99, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": {} - }, - "text": "I am a bit confused. What would you like to chat about?", - "confidence": 0.5, - "human_attributes": {}, - "bot_attributes": {}, - "type": "dummy" - }, - { - "skill_name": "dummy_skill", - "annotations": { - "sentence_ranker": -0.04437091201543808, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.02, - "General_ChatIntent": 0.18, - "Information_DeliveryIntent": 0.33, - "Information_RequestIntent": 0.13, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.01, - "Opinion_ExpressionIntent": 0.27, - "Opinion_RequestIntent": 0.01, - "OtherIntent": 0.02, - "Topic_SwitchIntent": 0.01, - "User_InstructionIntent": 0.03 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.07, - "Entertainment_General": 0.06, - "Entertainment_Movies": 0.06, - "Entertainment_Music": 0.67, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.01, - "Politics": 0.01, - "Science_and_Technology": 0.11, - "Sports": 0.01 - }, - "cobot_topics": { - "Art_Event": 0.0, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.0, - "Literature": 0.01, - "Math": 0.0, - "Movies_TV": 0.0, - "Music": 0.09, - "News": 0.0, - "Other": 0.0, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.0, - "Psychology": 0.85, - "Religion": 0.03, - "SciTech": 0.0, - "Sex_Profanity": 0.0, - "Sports": 0.0, - "Travel_Geo": 0.0, - "Weather_Time": 0.0 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.0, - "Beauty": 0.0, - "Books&Literature": 0.0, - "Celebrities&Events": 0.04, - "Clothes": 0.0, - "Depression": 0.01, - "Disasters": 0.0, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.0, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.0, - "Home&Design": 0.0, - "Job": 0.0, - "Leisure": 0.0, - "MassTransit": 0.0, - "Movies&Tv": 0.0, - "Music": 0.12, - "News": 0.02, - "PersonalTransport": 0.0, - "Politics": 0.0, - "Psychology": 0.43, - "Religion": 0.29, - "Science&Technology": 0.06, - "Space": 0.0, - "Sports": 0.0, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.0 - }, - "emotion_classification": { - "anger": 0.0, - "disgust": 0.0, - "fear": 0.01, - "joy": 0.92, - "neutral": 0.05, - "sadness": 0.01, - "surprise": 0.01 - }, - "factoid_classification": { - "is_conversational": 0.74, - "is_factoid": 0.26 - }, - "midas_classification": { - "appreciation": 0.05, - "clarifying_question": 0.0, - "command": 0.09, - "comment": 0.1, - "complaint": 0.01, - "dev_command": 0.02, - "neg_answer": 0.0, - "open_question_factual": 0.01, - "open_question_opinion": 0.02, - "open_question_personal": 0.0, - "opinion": 0.47, - "other_answers": 0.02, - "pos_answer": 0.12, - "statement": 0.05, - "yes_no_question": 0.03 - }, - "sentiment_classification": { - "negative": 0.09, - "neutral": 0.68, - "positive": 0.23 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 1.0, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": { - "entities": [ - "music", - "humanity", - "planet", - "music", - "music", - "band" - ], - "labelled_entities": [ - { - "finegrained_label": [ - [ - "misc", - 0.9971 - ] - ], - "label": "misc", - "offsets": [ - 34, - 39 - ], - "text": "music" - }, - { - "finegrained_label": [ - [ - "misc", - 0.9832 - ] - ], - "label": "misc", - "offsets": [ - 94, - 102 - ], - "text": "humanity" - }, - { - "finegrained_label": [ - [ - "misc", - 0.9887 - ] - ], - "label": "misc", - "offsets": [ - 157, - 163 - ], - "text": "planet" - }, - { - "finegrained_label": [ - [ - "misc", - 0.9974 - ] - ], - "label": "misc", - "offsets": [ - 191, - 196 - ], - "text": "music" - }, - { - "finegrained_label": [ - [ - "misc", - 0.9974 - ] - ], - "label": "misc", - "offsets": [ - 215, - 220 - ], - "text": "music" - }, - { - "finegrained_label": [ - [ - "misc", - 0.995 - ] - ], - "label": "misc", - "offsets": [ - 251, - 255 - ], - "text": "band" - } - ] - } - }, - "text": "I wanted to mention that, I think music in itself is healing. It's an explosive expression of humanity. It's something we are all touched by. No matter what planet we're from, everyone loves music. Let's talk about music, Who do you think is the best band ever?", - "confidence": 0.05, - "human_attributes": { - "used_links": { - "dff_music_skill": [ - "I wanted to mention that, I think music in itself is healing. It's an explosive expression of humanity. It's something we are all touched by. No matter what planet we're from, everyone loves music. Let's talk about music, Who do you think is the best band ever?" - ] - }, - "used_wiki_topics": [], - "disliked_skills": {}, - "prelinkto_connections": [ - "I think music in itself is healing. It's an explosive expression of humanity. It's something we are all touched by. No matter what planet we're from, everyone loves music." - ] - }, - "bot_attributes": {}, - "type": "link_to_for_response_selector", - "response_parts": [ - "prompt" - ] - }, - { - "skill_name": "dff_dream_faq_prompted_skill", - "annotations": { - "sentence_ranker": 0.4274880886077881, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.02, - "General_ChatIntent": 0.57, - "Information_DeliveryIntent": 0.26, - "Information_RequestIntent": 0.04, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.02, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.02, - "Topic_SwitchIntent": 0.04, - "User_InstructionIntent": 0.02 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.05, - "Entertainment_General": 0.1, - "Entertainment_Movies": 0.03, - "Entertainment_Music": 0.14, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.26, - "Politics": 0.01, - "Science_and_Technology": 0.4, - "Sports": 0.01 - }, - "cobot_topics": { - "Art_Event": 0.0, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.01, - "Games": 0.01, - "Literature": 0.01, - "Math": 0.02, - "Movies_TV": 0.0, - "Music": 0.05, - "News": 0.0, - "Other": 0.1, - "Pets_Animals": 0.03, - "Phatic": 0.0, - "Politics": 0.01, - "Psychology": 0.1, - "Religion": 0.0, - "SciTech": 0.6, - "Sex_Profanity": 0.01, - "Sports": 0.01, - "Travel_Geo": 0.0, - "Weather_Time": 0.04 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.04, - "Beauty": 0.0, - "Books&Literature": 0.0, - "Celebrities&Events": 0.0, - "Clothes": 0.0, - "Depression": 0.0, - "Disasters": 0.01, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.0, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.0, - "Home&Design": 0.0, - "Job": 0.9, - "Leisure": 0.0, - "MassTransit": 0.0, - "Movies&Tv": 0.0, - "Music": 0.0, - "News": 0.0, - "PersonalTransport": 0.0, - "Politics": 0.0, - "Psychology": 0.0, - "Religion": 0.0, - "Science&Technology": 0.02, - "Space": 0.01, - "Sports": 0.0, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.0 - }, - "emotion_classification": { - "anger": 0.31, - "disgust": 0.01, - "fear": 0.02, - "joy": 0.06, - "neutral": 0.41, - "sadness": 0.17, - "surprise": 0.03 - }, - "factoid_classification": { - "is_conversational": 0.06, - "is_factoid": 0.94 - }, - "midas_classification": { - "appreciation": 0.02, - "clarifying_question": 0.0, - "command": 0.15, - "comment": 0.03, - "complaint": 0.06, - "dev_command": 0.06, - "neg_answer": 0.02, - "open_question_factual": 0.05, - "open_question_opinion": 0.02, - "open_question_personal": 0.0, - "opinion": 0.25, - "other_answers": 0.03, - "pos_answer": 0.04, - "statement": 0.25, - "yes_no_question": 0.02 - }, - "sentiment_classification": { - "negative": 0.55, - "neutral": 0.44, - "positive": 0.01 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 0.99, - "obscene": 0.0, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.0 - } - }, - "entity_detection": { - "entities": [ - "software installations" - ], - "labelled_entities": [ - { - "finegrained_label": [ - [ - "misc", - 0.6953 - ] - ], - "label": "misc", - "offsets": [ - 70, - 92 - ], - "text": "software installations" - } - ] - } - }, - "text": "I'm sorry, but I'm unable to execute commands or assist with specific software installations. However, I'm here to answer any questions you may have about DeepPavlov Dream. Feel free to ask anything!", - "confidence": 0.9, - "human_attributes": { - "age_group": "", - "dff_dream_faq_prompted_skill_state": { - "context": { - "actor_state": {}, - "id": "cd7f9d3c-8a93-47af-9eb6-5b245565ff5c", - "labels": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "misc": {}, - "requests": { - "0": "source /home/smilga/dream/venv/bin/activate." - }, - "responses": { - "0": [ - [ - "I'm sorry, but I'm unable to execute commands or assist with specific software installations. However, I'm here to answer any questions you may have about DeepPavlov Dream. Feel free to ask anything!", - 0.9, - {}, - {}, - { - "can_continue": "no", - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - } - } - ] - ] - }, - "validation": false - }, - "current_turn_dff_suspended": false, - "history": { - "1": [ - "generation", - "generative_response_node" - ] - }, - "previous_human_utter_index": 1, - "shared_memory": {} - }, - "dff_shared_state": { - "cross_links": {}, - "cross_states": {} - }, - "disliked_skills": {}, - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - }, - "used_links": {} - }, - "bot_attributes": {}, - "can_continue": "no", - "is_final_answer": "true", - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - } - }, - { - "skill_name": "dff_dream_persona_prompted_skill", - "annotations": { - "sentence_ranker": 0.3869864344596863, - "combined_classification": { - "cobot_dialogact_intents": { - "ClarificationIntent": 0.01, - "General_ChatIntent": 0.36, - "Information_DeliveryIntent": 0.53, - "Information_RequestIntent": 0.02, - "InteractiveIntent": 0.0, - "Multiple_GoalsIntent": 0.0, - "Opinion_ExpressionIntent": 0.01, - "Opinion_RequestIntent": 0.0, - "OtherIntent": 0.01, - "Topic_SwitchIntent": 0.01, - "User_InstructionIntent": 0.03 - }, - "cobot_dialogact_topics": { - "Entertainment_Books": 0.02, - "Entertainment_General": 0.51, - "Entertainment_Movies": 0.06, - "Entertainment_Music": 0.07, - "Inappropriate_Content": 0.0, - "Interactive": 0.0, - "Other": 0.0, - "Phatic": 0.06, - "Politics": 0.0, - "Science_and_Technology": 0.25, - "Sports": 0.02 - }, - "cobot_topics": { - "Art_Event": 0.01, - "Celebrities": 0.0, - "Entertainment": 0.0, - "Fashion": 0.0, - "Food_Drink": 0.0, - "Games": 0.02, - "Literature": 0.0, - "Math": 0.01, - "Movies_TV": 0.0, - "Music": 0.01, - "News": 0.0, - "Other": 0.02, - "Pets_Animals": 0.0, - "Phatic": 0.0, - "Politics": 0.0, - "Psychology": 0.02, - "Religion": 0.0, - "SciTech": 0.88, - "Sex_Profanity": 0.0, - "Sports": 0.0, - "Travel_Geo": 0.0, - "Weather_Time": 0.02 - }, - "deeppavlov_topics": { - "Animals&Pets": 0.0, - "Art&Hobbies": 0.0, - "ArtificialIntelligence": 0.05, - "Beauty": 0.0, - "Books&Literature": 0.0, - "Celebrities&Events": 0.0, - "Clothes": 0.0, - "Depression": 0.0, - "Disasters": 0.07, - "Education": 0.0, - "Family&Relationships": 0.0, - "Finance": 0.0, - "Food": 0.0, - "Gadgets": 0.0, - "Garden": 0.0, - "Health&Medicine": 0.0, - "Home&Design": 0.0, - "Job": 0.17, - "Leisure": 0.0, - "MassTransit": 0.0, - "Movies&Tv": 0.0, - "Music": 0.0, - "News": 0.0, - "PersonalTransport": 0.0, - "Politics": 0.0, - "Psychology": 0.0, - "Religion": 0.0, - "Science&Technology": 0.01, - "Space": 0.61, - "Sports": 0.0, - "Toys&Games": 0.0, - "Travel": 0.0, - "Videogames": 0.08 - }, - "emotion_classification": { - "anger": 0.01, - "disgust": 0.0, - "fear": 0.0, - "joy": 0.89, - "neutral": 0.04, - "sadness": 0.0, - "surprise": 0.05 - }, - "factoid_classification": { - "is_conversational": 0.04, - "is_factoid": 0.96 - }, - "midas_classification": { - "appreciation": 0.19, - "clarifying_question": 0.0, - "command": 0.05, - "comment": 0.05, - "complaint": 0.02, - "dev_command": 0.05, - "neg_answer": 0.01, - "open_question_factual": 0.03, - "open_question_opinion": 0.02, - "open_question_personal": 0.0, - "opinion": 0.15, - "other_answers": 0.02, - "pos_answer": 0.08, - "statement": 0.3, - "yes_no_question": 0.02 - }, - "sentiment_classification": { - "negative": 0.15, - "neutral": 0.33, - "positive": 0.52 - }, - "toxic_classification": { - "identity_hate": 0.0, - "insult": 0.0, - "not_toxic": 0.98, - "obscene": 0.01, - "severe_toxic": 0.0, - "sexual_explicit": 0.0, - "threat": 0.0, - "toxic": 0.01 - } - }, - "entity_detection": { - "entities": [ - "virtual environment" - ], - "labelled_entities": [ - { - "finegrained_label": [ - [ - "misc", - 0.8303 - ] - ], - "label": "misc", - "offsets": [ - 42, - 61 - ], - "text": "virtual environment" - } - ] - } - }, - "text": "It seems like you're trying to activate a virtual environment! That command looks correct, but I'm unable to execute it myself as I am a chatbot. Is there anything else I can help you with?", - "confidence": 0.9, - "human_attributes": { - "age_group": "", - "dff_dream_persona_prompted_skill_state": { - "context": { - "actor_state": {}, - "id": "320d6186-8994-4895-95fc-36a4490e2cc3", - "labels": { - "0": [ - "generation", - "generative_response_node" - ], - "1": [ - "generation", - "generative_response_node" - ] - }, - "misc": {}, - "requests": { - "0": "hi.", - "1": "source /home/smilga/dream/venv/bin/activate." - }, - "responses": { - "0": [ - [ - "Hello! It's lovely to meet you. How can I assist you today?", - 0.9, - {}, - {}, - { - "can_continue": "no" - } - ] - ], - "1": [ - [ - "It seems like you're trying to activate a virtual environment! That command looks correct, but I'm unable to execute it myself as I am a chatbot. Is there anything else I can help you with?", - 0.9, - {}, - {}, - { - "can_continue": "no" - } - ] - ] - }, - "validation": false - }, - "current_turn_dff_suspended": false, - "history": { - "0": [ - "generation", - "generative_response_node" - ], - "1": [ - "generation", - "generative_response_node" - ] - }, - "previous_human_utter_index": 1, - "shared_memory": {} - }, - "dff_shared_state": { - "cross_links": {}, - "cross_states": {} - }, - "disliked_skills": {}, - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - }, - "used_links": {} - }, - "bot_attributes": {}, - "can_continue": "no", - "is_final_answer": "true" - } - ], - "date_time": "2023-08-10 12:10:35.006331", - "attributes": {} - } - ], - "bot_utterances": [ - { - "utt_id": "acdd897e1ae32fb2c160072221a207f1", - "text": "Hello! It's lovely to meet you. How can I assist you today?", - "orig_text": "Hello! It's lovely to meet you. How can I assist you today?", - "active_skill": "dff_dream_persona_prompted_skill", - "confidence": 0.9, - "annotations": { - "sentseg": { - "punct_sent": "Hello! It's lovely to meet you. How can I assist you today?", - "segments": [ - "Hello!", - "It's lovely to meet you.", - "How can I assist you today?" - ] - }, - "ner": [ - [ - { - "confidence": 1, - "end_pos": 1, - "start_pos": 0, - "text": "Hello", - "type": "CARDINAL" - } - ], - [], - [] - ] - }, - "date_time": "2023-08-10 10:16:41.788000", - "user": { - "id": "089e50bfc4fa483bb408d0264b8f6ef4", - "persona": {}, - "attributes": { - "summarized_dialog": "" - }, - "user_type": "bot" - }, - "attributes": { - "can_continue": "no", - "is_final_answer": "true" - } - } - ], - "human": { - "id": "64d4b9095c75901b774c6e52", - "user_external_id": "nfejviuewfiubfeiuvbwefioubuivwebofiboiuvw", - "persona": {}, - "profile": { - "name": null, - "gender": null, - "birthdate": null, - "location": null, - "home_coordinates": null, - "work_coordinates": null, - "occupation": null, - "income_per_year": null - }, - "attributes": { - "prompts_goals": { - "dream_faq": "Answers FAQ questions about DeepPavlov Dream, its architecture, licensing, usage, and advantages compared to other platforms." - }, - "age_group": "", - "dff_dream_persona_prompted_skill_state": { - "context": { - "actor_state": {}, - "id": "320d6186-8994-4895-95fc-36a4490e2cc3", - "labels": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "misc": {}, - "requests": { - "0": "hi." - }, - "responses": { - "0": [ - [ - "Hello! It's lovely to meet you. How can I assist you today?", - 0.9, - {}, - {}, - { - "can_continue": "no" - } - ] - ] - }, - "validation": false - }, - "current_turn_dff_suspended": false, - "history": { - "0": [ - "generation", - "generative_response_node" - ] - }, - "previous_human_utter_index": 0, - "shared_memory": {} - }, - "dff_shared_state": { - "cross_links": {}, - "cross_states": {} - }, - "disliked_skills": {}, - "used_links": {} - }, - "user_type": "human" - }, - "bot": { - "id": "64d4b9095c75901b774c6e53", - "persona": {}, - "attributes": { - "summarized_dialog": "" - }, - "user_type": "bot" - }, - "channel_type": "cmd_client", - "date_start": "2023-08-10 10:16:39.741000", - "date_finish": "2023-08-10 10:16:41.788000", - "_active": "True", - "attributes": { - "pipeline": [ - "annotators.sentseg", - "annotators.prompt_goals_collector", - "annotators.prompt_selector", - "annotators.intent_catcher", - "annotators.fact_retrieval", - "annotators.ner", - "annotators.entity_detection", - "annotators.kbqa", - "annotators.entity_linking", - "annotators.wiki_parser", - "annotators.combined_classification", - "annotators.summarization_annotator", - "response_annotators.sentseg", - "response_annotators.ner", - "response_annotator_selectors", - "candidate_annotators.entity_detection", - "candidate_annotators.combined_classification", - "candidate_annotators.sentence_ranker", - "candidate_annotators.fact_checking", - "skill_selectors.description_based_skill_selector", - "skills.dff_dream_persona_prompted_skill", - "skills.dff_google_api_skill", - "skills.dff_intent_responder_skill", - "skills.dummy_skill", - "skills.factoid_qa", - "skills.dff_dream_faq_prompted_skill", - "response_selectors.response_selector", - "input", - "responder" - ] - } -} \ No newline at end of file From c5f0274cede9a1c339b1ae2454c89623fbe71b89 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Mon, 14 Aug 2023 21:07:38 +0300 Subject: [PATCH 06/35] better logging & not checking some skills --- annotators/fact_checking/server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/annotators/fact_checking/server.py b/annotators/fact_checking/server.py index cda802f22d..fef55b398e 100644 --- a/annotators/fact_checking/server.py +++ b/annotators/fact_checking/server.py @@ -23,6 +23,7 @@ if GENERATIVE_SERVICE_CONFIG: with open(f"common/generative_configs/{GENERATIVE_SERVICE_CONFIG}", "r") as f: GENERATIVE_SERVICE_CONFIG = json.load(f) +SKILLS_NOT_TO_CHECK = ["dummy_skill", "dff_intent_responder_skill"] def check_hyp_with_llm(curr_prompt, human_uttr_attr): @@ -43,7 +44,6 @@ def check_hyp_with_llm(curr_prompt, human_uttr_attr): sending_variables, ) result = response[0] - logger.info(f"llm response: `{result}`") if 'yes' in result.lower(): _is_hyp_correct = False else: @@ -64,6 +64,9 @@ def respond(): if ie_type == "external": logger.info(f"Hypothesis `{hyp_text}` is considered correct as it is external.") results += ["Correct"] + elif hyp["skill_name"] in SKILLS_NOT_TO_CHECK: + logger.info(f"Hypothesis `{hyp_text}` is not checked as it was produced by {hyp['skill_name']}.") + results += ["Correct"] else: if len(external_service_hyps) == 0: logger.info(f"Hypothesis `{hyp_text}` is considered correct as there are no external hypotheses to check it upon.") @@ -73,7 +76,6 @@ def respond(): for external_service_hyp, external_service_name in external_service_hyps: curr_prompt = f'''Hypothesis: "{hyp_text}" Does Hypothesis contradict Fact that {external_service_hyp}? Always answer only Yes or No without explanation.''' - logger.info(f"Prompt sent to LLM by fact-checking:\n`{curr_prompt}`") _is_hyp_correct_one_step = check_hyp_with_llm(curr_prompt, human_uttr_attr) if not _is_hyp_correct_one_step: _is_hyp_correct = False From 98f0f209e5d19dd969ccad9cf68e97688f2efd6e Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Mon, 14 Aug 2023 21:08:06 +0300 Subject: [PATCH 07/35] modifying response selector to include fact-checking --- .../dream/docker-compose.override.yml | 4 +- .../Dockerfile | 8 ++ .../ranking_based_response_selector/server.py | 77 ++++++++----------- 3 files changed, 45 insertions(+), 44 deletions(-) diff --git a/assistant_dists/dream/docker-compose.override.yml b/assistant_dists/dream/docker-compose.override.yml index a05b41e412..3b20b4252f 100644 --- a/assistant_dists/dream/docker-compose.override.yml +++ b/assistant_dists/dream/docker-compose.override.yml @@ -27,8 +27,10 @@ services: SENTENCE_RANKER_ANNOTATION_NAME: sentence_ranker SENTENCE_RANKER_SERVICE_URL: http://sentence-ranker:8128/respond SENTENCE_RANKER_TIMEOUT: 3 - FACTUAL_CONFORMITY_SERVICE_URL: http://openai-api-chatgpt:8145/respond + ENABLE_FACT_CHECKING: 1 + FACTUAL_CONFORMITY_SERVICE_URL: http://fact-checking:8182/respond FACTUAL_CONFORMITY_SERVICE_TIMEOUT: 5 + FACTUAL_CONFORMITY_ANNOTATION_NAME: fact_checking N_UTTERANCES_CONTEXT: 5 FILTER_TOXIC_OR_BADLISTED: 1 FALLBACK_FILE: fallbacks_dream_en.json diff --git a/response_selectors/ranking_based_response_selector/Dockerfile b/response_selectors/ranking_based_response_selector/Dockerfile index 67666b5916..2be1540b5f 100644 --- a/response_selectors/ranking_based_response_selector/Dockerfile +++ b/response_selectors/ranking_based_response_selector/Dockerfile @@ -17,6 +17,14 @@ ARG N_UTTERANCES_CONTEXT=5 ENV N_UTTERANCES_CONTEXT ${N_UTTERANCES_CONTEXT} ARG FILTER_TOXIC_OR_BADLISTED=1 ENV FILTER_TOXIC_OR_BADLISTED ${FILTER_TOXIC_OR_BADLISTED} +ARG FACTUAL_CONFORMITY_SERVICE_URL +ENV FACTUAL_CONFORMITY_SERVICE_URL ${FACTUAL_CONFORMITY_SERVICE_URL} +ARG FACTUAL_CONFORMITY_SERVICE_TIMEOUT +ENV FACTUAL_CONFORMITY_SERVICE_TIMEOUT ${FACTUAL_CONFORMITY_SERVICE_TIMEOUT} +ARG FACTUAL_CONFORMITY_ANNOTATION_NAME +ENV FACTUAL_CONFORMITY_ANNOTATION_NAME ${FACTUAL_CONFORMITY_ANNOTATION_NAME} +ARG ENABLE_FACT_CHECKING +ENV ENABLE_FACT_CHECKING ${ENABLE_FACT_CHECKING} COPY ./response_selectors/ranking_based_response_selector/ /src/ WORKDIR /src diff --git a/response_selectors/ranking_based_response_selector/server.py b/response_selectors/ranking_based_response_selector/server.py index a9824c6454..2f1cc8b313 100644 --- a/response_selectors/ranking_based_response_selector/server.py +++ b/response_selectors/ranking_based_response_selector/server.py @@ -23,12 +23,12 @@ SENTENCE_RANKER_SERVICE_URL = getenv("SENTENCE_RANKER_SERVICE_URL") SENTENCE_RANKER_TIMEOUT = int(getenv("SENTENCE_RANKER_TIMEOUT")) FILTER_TOXIC_OR_BADLISTED = int(getenv("FILTER_TOXIC_OR_BADLISTED")) +ENABLE_FACT_CHECKING = int(getenv("ENABLE_FACT_CHECKING")) N_UTTERANCES_CONTEXT = int(getenv("N_UTTERANCES_CONTEXT")) -# FACTUAL_CONFORMITY_SERVICE_URL = getenv("FACTUAL_CONFORMITY_SERVICE_URL") -# FACTUAL_CONFORMITY_SERVICE_TIMEOUT = int(getenv("FACTUAL_CONFORMITY_SERVICE_TIMEOUT")) -# EXTERNAL_SKILLS = ["factoid_qa", "dff_google_api_skill"] -# ENVVARS_TO_SEND = getenv("ENVVARS_TO_SEND", None) -# ENVVARS_TO_SEND = [] if ENVVARS_TO_SEND is None else ENVVARS_TO_SEND.split(",") +FACTUAL_CONFORMITY_SERVICE_URL = getenv("FACTUAL_CONFORMITY_SERVICE_URL") +FACTUAL_CONFORMITY_SERVICE_TIMEOUT = int(getenv("FACTUAL_CONFORMITY_SERVICE_TIMEOUT")) +FACTUAL_CONFORMITY_ANNOTATION_NAME = getenv("FACTUAL_CONFORMITY_ANNOTATION_NAME") + assert SENTENCE_RANKER_ANNOTATION_NAME or SENTENCE_RANKER_SERVICE_URL, logger.error( "Ranker service URL or annotator name should be given" ) @@ -44,44 +44,6 @@ def filter_out_badlisted_or_toxic(hypotheses): return clean_hypotheses -# def filter_out_false(hypotheses, human_uttr_attributes): -# try: -# ie_types = [ -# "external service" if hyp["skill_name"] in EXTERNAL_SKILLS else "internal service" for hyp in hypotheses -# ] -# hyps_and_ies = zip(hypotheses, ie_types) -# for hyp, ie in hyps_and_ies: -# curr_prompt = f'''Fact:{hyp} -# Hypothesis: {ie} -# Does Hypothesis contain any information that contradicts Fact? Only answer Yes or No.''' -# logger.info(f"filter_out_false sends prompt to llm:\n`{curr_prompt}`") -# lm_service_kwargs = human_uttr_attributes.pop("lm_service_kwargs", None) -# lm_service_kwargs = {} if lm_service_kwargs is None else lm_service_kwargs -# envvars_to_send = ENVVARS_TO_SEND if len(ENVVARS_TO_SEND) else human_uttr_attributes.get("envvars_to_send", []) -# sending_variables = compose_sending_variables( -# lm_service_kwargs, -# envvars_to_send, -# **human_uttr_attributes, -# ) -# response = send_request_to_prompted_generative_service( -# dialog_context, -# curr_prompt, -# GENERATIVE_SERVICE_URL, -# GENERATIVE_SERVICE_CONFIG, -# GENERATIVE_TIMEOUT, -# sending_variables, -# ) -# result = response[0] -# except Exception as e: -# sentry_sdk.capture_exception(e) -# logger.exception(e) -# result = select_response_by_scores(hypotheses, [hyp["confidence"] for hyp in hypotheses])[0] -# logger.info("Exception in LLM's invocation. Selected a response with the highest confidence.") -# logger.info(f"llm_based_response_selector selected:\n`{result}`") - -# return result - - def select_response_by_scores(hypotheses, scores): best_id = np.argmax(scores) result = hypotheses[best_id] @@ -111,6 +73,32 @@ def get_scores(dialog_context, hypotheses): return scores +def filter_out_factually_incorrect(hypotheses, human_uttr_attributes): + if all([FACTUAL_CONFORMITY_ANNOTATION_NAME in hyp.get("annotations", {}) for hyp in hypotheses]): + fact_check_result = [hyp.get("annotations", {}).get(FACTUAL_CONFORMITY_ANNOTATION_NAME, "Correct") for hyp in hypotheses] + logger.info(f"Got annotations from {FACTUAL_CONFORMITY_ANNOTATION_NAME}.") + else: + try: + fact_check_result = requests.post( + FACTUAL_CONFORMITY_SERVICE_URL, + json={"hypotheses": hypotheses, "human_uttr_attributes": human_uttr_attributes}, + timeout=FACTUAL_CONFORMITY_SERVICE_TIMEOUT, + ).json() + fact_check_result = np.array(fact_check_result[0]["batch"]) + logger.info(f"Annotated hypotheses via {FACTUAL_CONFORMITY_SERVICE_URL}.") + except Exception as e: + sentry_sdk.capture_exception(e) + fact_check_result = ["Correct" for _ in hypotheses] + logger.exception(e) + logger.info("Error. Marking all hypotheses as correct.") + clean_hypotheses = [hyp for hyp, res in zip(hypotheses, fact_check_result) if res =='Correct'] + logger.info(f"clean_hypotheses: {clean_hypotheses}\nfact_check_result: {fact_check_result}") + hypotheses_text = [hyp["text"] for hyp in hypotheses] + clean_hypotheses_text = [hyp["text"] for hyp in clean_hypotheses] + logger.info(f"Filtered out incorrect candidates: {'; '.join(set(hypotheses_text) - set(clean_hypotheses_text))}") + return clean_hypotheses + + def select_response(dialog_context, hypotheses): scores = get_scores(dialog_context, hypotheses) scores = [score if hyp["skill_name"] != "dummy_skill" else score - 1 for score, hyp in zip(scores, hypotheses)] @@ -136,8 +124,11 @@ def respond(): for i, dialog in enumerate(dialogs): hypotheses = [hyp for hyp in dialog["human_utterances"][-1]["hypotheses"]] + human_uttr_attributes = [dialog["human_utterances"][-1]["annotations"] for _ in hypotheses] if FILTER_TOXIC_OR_BADLISTED: hypotheses = filter_out_badlisted_or_toxic(hypotheses) + if ENABLE_FACT_CHECKING: + hypotheses = filter_out_factually_incorrect(hypotheses, human_uttr_attributes) hypotheses_texts = "\n".join([f'{h["skill_name"]} (conf={h["confidence"]}): {h["text"]}' for h in hypotheses]) logger.info(f"Hypotheses: {hypotheses_texts}") dialog_context = [uttr["text"] for uttr in dialog["utterances"][-N_UTTERANCES_CONTEXT:]] From 1fe10da47f6e3b32984bdad3bb7df70f61306018 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 12:28:19 +0300 Subject: [PATCH 08/35] added default ENABLE_FACT_CHECKING=0 to Dockerfile --- response_selectors/ranking_based_response_selector/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/response_selectors/ranking_based_response_selector/Dockerfile b/response_selectors/ranking_based_response_selector/Dockerfile index 2be1540b5f..75c4493524 100644 --- a/response_selectors/ranking_based_response_selector/Dockerfile +++ b/response_selectors/ranking_based_response_selector/Dockerfile @@ -23,7 +23,7 @@ ARG FACTUAL_CONFORMITY_SERVICE_TIMEOUT ENV FACTUAL_CONFORMITY_SERVICE_TIMEOUT ${FACTUAL_CONFORMITY_SERVICE_TIMEOUT} ARG FACTUAL_CONFORMITY_ANNOTATION_NAME ENV FACTUAL_CONFORMITY_ANNOTATION_NAME ${FACTUAL_CONFORMITY_ANNOTATION_NAME} -ARG ENABLE_FACT_CHECKING +ARG ENABLE_FACT_CHECKING=0 ENV ENABLE_FACT_CHECKING ${ENABLE_FACT_CHECKING} COPY ./response_selectors/ranking_based_response_selector/ /src/ From 0ca699950edd7909b42bce643ba99b9d2b003fe0 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 12:33:43 +0300 Subject: [PATCH 09/35] added default FACTUAL_CONFORMITY_SERVICE_TIMEOUT=0 to Dockerfile --- response_selectors/ranking_based_response_selector/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/response_selectors/ranking_based_response_selector/Dockerfile b/response_selectors/ranking_based_response_selector/Dockerfile index 75c4493524..e04ee36feb 100644 --- a/response_selectors/ranking_based_response_selector/Dockerfile +++ b/response_selectors/ranking_based_response_selector/Dockerfile @@ -19,7 +19,7 @@ ARG FILTER_TOXIC_OR_BADLISTED=1 ENV FILTER_TOXIC_OR_BADLISTED ${FILTER_TOXIC_OR_BADLISTED} ARG FACTUAL_CONFORMITY_SERVICE_URL ENV FACTUAL_CONFORMITY_SERVICE_URL ${FACTUAL_CONFORMITY_SERVICE_URL} -ARG FACTUAL_CONFORMITY_SERVICE_TIMEOUT +ARG FACTUAL_CONFORMITY_SERVICE_TIMEOUT=0 ENV FACTUAL_CONFORMITY_SERVICE_TIMEOUT ${FACTUAL_CONFORMITY_SERVICE_TIMEOUT} ARG FACTUAL_CONFORMITY_ANNOTATION_NAME ENV FACTUAL_CONFORMITY_ANNOTATION_NAME ${FACTUAL_CONFORMITY_ANNOTATION_NAME} From 769dba1bae95e9664e4c4b4b191cde1f78018b32 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 12:39:38 +0300 Subject: [PATCH 10/35] improved logging + minor fixes --- .../ranking_based_response_selector/server.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/response_selectors/ranking_based_response_selector/server.py b/response_selectors/ranking_based_response_selector/server.py index 2f1cc8b313..8e80351aca 100644 --- a/response_selectors/ranking_based_response_selector/server.py +++ b/response_selectors/ranking_based_response_selector/server.py @@ -32,6 +32,10 @@ assert SENTENCE_RANKER_ANNOTATION_NAME or SENTENCE_RANKER_SERVICE_URL, logger.error( "Ranker service URL or annotator name should be given" ) +if ENABLE_FACT_CHECKING: + assert FACTUAL_CONFORMITY_ANNOTATION_NAME or FACTUAL_CONFORMITY_SERVICE_URL, logger.error( + "Fact-checker service URL or annotator name should be given" +) def filter_out_badlisted_or_toxic(hypotheses): clean_hypotheses = [] @@ -84,7 +88,7 @@ def filter_out_factually_incorrect(hypotheses, human_uttr_attributes): json={"hypotheses": hypotheses, "human_uttr_attributes": human_uttr_attributes}, timeout=FACTUAL_CONFORMITY_SERVICE_TIMEOUT, ).json() - fact_check_result = np.array(fact_check_result[0]["batch"]) + fact_check_result = fact_check_result[0]["batch"] logger.info(f"Annotated hypotheses via {FACTUAL_CONFORMITY_SERVICE_URL}.") except Exception as e: sentry_sdk.capture_exception(e) @@ -92,10 +96,10 @@ def filter_out_factually_incorrect(hypotheses, human_uttr_attributes): logger.exception(e) logger.info("Error. Marking all hypotheses as correct.") clean_hypotheses = [hyp for hyp, res in zip(hypotheses, fact_check_result) if res =='Correct'] - logger.info(f"clean_hypotheses: {clean_hypotheses}\nfact_check_result: {fact_check_result}") hypotheses_text = [hyp["text"] for hyp in hypotheses] clean_hypotheses_text = [hyp["text"] for hyp in clean_hypotheses] - logger.info(f"Filtered out incorrect candidates: {'; '.join(set(hypotheses_text) - set(clean_hypotheses_text))}") + logger.info(f"""Filtered out incorrect candidates: {'; '.join(set(hypotheses_text) - set(clean_hypotheses_text))} +Remaining candidates: {clean_hypotheses_text}""") return clean_hypotheses From c852ac3069a70155886e4f6bcee37f8dbf057211 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 14:55:01 +0300 Subject: [PATCH 11/35] upd timeout --- response_selectors/ranking_based_response_selector/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/response_selectors/ranking_based_response_selector/Dockerfile b/response_selectors/ranking_based_response_selector/Dockerfile index e04ee36feb..b50f7b5930 100644 --- a/response_selectors/ranking_based_response_selector/Dockerfile +++ b/response_selectors/ranking_based_response_selector/Dockerfile @@ -19,7 +19,7 @@ ARG FILTER_TOXIC_OR_BADLISTED=1 ENV FILTER_TOXIC_OR_BADLISTED ${FILTER_TOXIC_OR_BADLISTED} ARG FACTUAL_CONFORMITY_SERVICE_URL ENV FACTUAL_CONFORMITY_SERVICE_URL ${FACTUAL_CONFORMITY_SERVICE_URL} -ARG FACTUAL_CONFORMITY_SERVICE_TIMEOUT=0 +ARG FACTUAL_CONFORMITY_SERVICE_TIMEOUT=5 ENV FACTUAL_CONFORMITY_SERVICE_TIMEOUT ${FACTUAL_CONFORMITY_SERVICE_TIMEOUT} ARG FACTUAL_CONFORMITY_ANNOTATION_NAME ENV FACTUAL_CONFORMITY_ANNOTATION_NAME ${FACTUAL_CONFORMITY_ANNOTATION_NAME} From 58d426de6e1b6b71eeec46723bfea4e83b925540 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 15:00:49 +0300 Subject: [PATCH 12/35] update README for ranking_based_response_selector by adding fact-checking --- .../ranking_based_response_selector/README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/response_selectors/ranking_based_response_selector/README.md b/response_selectors/ranking_based_response_selector/README.md index fa7c57f67e..9a9f01055d 100644 --- a/response_selectors/ranking_based_response_selector/README.md +++ b/response_selectors/ranking_based_response_selector/README.md @@ -8,11 +8,15 @@ to rank hypotheses and selects the best ranked one. ### Parameters -Utilizes annotations by `SENTENCE_RANKER_ANNOTATION_NAME` candidate annotator. -In case of absence of these annotations, utilizes provided `SENTENCE_RANKER_SERVICE_URL` to annotate hypotheses +Utilizes annotations by `SENTENCE_RANKER_ANNOTATION_NAME` candidate annotator. If these annotations are absent, utilizes provided `SENTENCE_RANKER_SERVICE_URL` to annotate hypotheses according to `N_UTTERANCES_CONTEXT` last utterances. -Parameter `FILTER_TOXIC_OR_BADLISTED` defines whether it filers out toxic hypotheses or not. + +Parameter `FILTER_TOXIC_OR_BADLISTED` defines whether to filer out toxic hypotheses or not. + +Parameter `ENABLE_FACT_CHECKING` defines whether to filter out factually incorrect hypotheses. To define if a hypothesis is factually correct, Response Selector either uses the existing candidate annotation specified in `FACTUAL_CONFORMITY_ANNOTATION_NAME` or posts requests to the service or annotator specified in `FACTUAL_CONFORMITY_SERVICE_URL` with `FACTUAL_CONFORMITY_SERVICE_TIMEOUT` timeout. + ## Dependencies -- either candidate annotations by `SENTENCE_RANKER_ANNOTATION_NAME` or service `SENTENCE_RANKER_SERVICE_URL`. \ No newline at end of file +- either candidate annotations by `SENTENCE_RANKER_ANNOTATION_NAME` or service `SENTENCE_RANKER_SERVICE_URL` +- __if `ENABLE_FACT_CHECKING=1`:__ candidate annotations by `FACTUAL_CONFORMITY_ANNOTATION_NAME` or service `FACTUAL_CONFORMITY_SERVICE_URL` \ No newline at end of file From 0b5b157cc32da424851b30ff566bff041139d823 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 16:09:12 +0300 Subject: [PATCH 13/35] removed or modified obsolete files --- .../fact_checking/doc_retriever_config.json | 82 ------- annotators/fact_checking/requirements.txt | 6 +- annotators/fact_checking/server.py | 9 +- annotators/fact_checking/test.sh | 2 +- annotators/fact_checking/utils.py | 202 ------------------ 5 files changed, 7 insertions(+), 294 deletions(-) delete mode 100644 annotators/fact_checking/doc_retriever_config.json delete mode 100644 annotators/fact_checking/utils.py diff --git a/annotators/fact_checking/doc_retriever_config.json b/annotators/fact_checking/doc_retriever_config.json deleted file mode 100644 index be9dd12a4e..0000000000 --- a/annotators/fact_checking/doc_retriever_config.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "dataset_reader": { - "class_name": "odqa_reader", - "data_path": "", - "save_path": "/data/odqa/userfile.db", - "dataset_format": "wiki" - }, - "dataset_iterator": { - "class_name": "sqlite_iterator", - "shuffle": false, - "load_path": "/data/odqa/userfile.db" - }, - "chainer": { - "in": [ - "docs" - ], - "in_y": [ - "doc_ids", - "doc_nums" - ], - "out": [ - "tfidf_doc_ids" - ], - "pipe": [ - { - "class_name": "hashing_tfidf_vectorizer", - "id": "vectorizer", - "fit_on": [ - "docs", - "doc_ids", - "doc_nums" - ], - "save_path": "/data/odqa/userfile_tfidf_matrix.npz", - "load_path": "/data/odqa/userfile_tfidf_matrix.npz", - "tokenizer": { - "class_name": "stream_spacy_tokenizer", - "lemmas": true, - "lowercase": true, - "filter_stopwords": true, - "ngram_range": [ - 1, - 2 - ] - } - }, - { - "class_name": "tfidf_ranker", - "top_n": 12, - "in": [ - "docs" - ], - "out": [ - "tfidf_doc_ids", - "tfidf_doc_scores" - ], - "vectorizer": "#vectorizer" - } - ] - }, - "train": { - "batch_size": 10000, - "evaluation_targets": [], - "class_name": "fit_trainer" - }, - "metadata": { - "variables": { - "ROOT_PATH": "~/.deeppavlov", - "DOWNLOADS_PATH": "{ROOT_PATH}/downloads", - "MODELS_PATH": "{ROOT_PATH}/models" - }, - "download": [ - { - "url": "http://files.deeppavlov.ai/datasets/wikipedia/enwiki.tar.gz", - "subdir": "{DOWNLOADS_PATH}" - }, - { - "url": "http://files.deeppavlov.ai/deeppavlov_data/en_odqa.tar.gz", - "subdir": "{MODELS_PATH}" - } - ] - } -} \ No newline at end of file diff --git a/annotators/fact_checking/requirements.txt b/annotators/fact_checking/requirements.txt index b14d3440c6..943a79ef67 100644 --- a/annotators/fact_checking/requirements.txt +++ b/annotators/fact_checking/requirements.txt @@ -6,8 +6,4 @@ sentry-sdk[flask]==0.14.1 healthcheck==1.3.3 jinja2<=3.0.3 Werkzeug<=2.0.3 -deeppavlov==1.1.1 -nltk==3.8.1 -spacy==3.5 -pypdfium2==4.16.0 -bs4==0.0.1 \ No newline at end of file +deeppavlov==1.1.1 \ No newline at end of file diff --git a/annotators/fact_checking/server.py b/annotators/fact_checking/server.py index fef55b398e..6ced8e48e6 100644 --- a/annotators/fact_checking/server.py +++ b/annotators/fact_checking/server.py @@ -5,6 +5,7 @@ from flask import Flask, jsonify, request from sentry_sdk.integrations.flask import FlaskIntegration from common.prompts import send_request_to_prompted_generative_service, compose_sending_variables +from common.response_selection import SKILLS_NOT_TO_FACT_CHECK # logging here because it conflicts with tf @@ -23,7 +24,6 @@ if GENERATIVE_SERVICE_CONFIG: with open(f"common/generative_configs/{GENERATIVE_SERVICE_CONFIG}", "r") as f: GENERATIVE_SERVICE_CONFIG = json.load(f) -SKILLS_NOT_TO_CHECK = ["dummy_skill", "dff_intent_responder_skill"] def check_hyp_with_llm(curr_prompt, human_uttr_attr): @@ -64,7 +64,7 @@ def respond(): if ie_type == "external": logger.info(f"Hypothesis `{hyp_text}` is considered correct as it is external.") results += ["Correct"] - elif hyp["skill_name"] in SKILLS_NOT_TO_CHECK: + elif hyp["skill_name"] in SKILLS_NOT_TO_FACT_CHECK: logger.info(f"Hypothesis `{hyp_text}` is not checked as it was produced by {hyp['skill_name']}.") results += ["Correct"] else: @@ -74,8 +74,9 @@ def respond(): else: _is_hyp_correct = True for external_service_hyp, external_service_name in external_service_hyps: - curr_prompt = f'''Hypothesis: "{hyp_text}" -Does Hypothesis contradict Fact that {external_service_hyp}? Always answer only Yes or No without explanation.''' + curr_prompt = f"""Hypothesis: "{hyp_text}" +Does Hypothesis contradict Fact that {external_service_hyp}? Always answer only Yes or No without explanation.""" + logger.info(f"Checking internal hypothesis `{hyp_text}` with LLM. Prompt: {curr_prompt}") _is_hyp_correct_one_step = check_hyp_with_llm(curr_prompt, human_uttr_attr) if not _is_hyp_correct_one_step: _is_hyp_correct = False diff --git a/annotators/fact_checking/test.sh b/annotators/fact_checking/test.sh index 4c8a0d1983..61672db785 100755 --- a/annotators/fact_checking/test.sh +++ b/annotators/fact_checking/test.sh @@ -1,3 +1,3 @@ #!/bin/bash -# python test.py +python test.py diff --git a/annotators/fact_checking/utils.py b/annotators/fact_checking/utils.py deleted file mode 100644 index 180510d475..0000000000 --- a/annotators/fact_checking/utils.py +++ /dev/null @@ -1,202 +0,0 @@ -import requests -import logging -import os -import random -import string -import time -import shutil -import pypdfium2 as pdfium - -from pathlib import PurePath -from bs4 import BeautifulSoup -from deeppavlov import train_model -from common.build_dataset import build_dataset -from urllib.parse import urlparse - - -logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO) -logger = logging.getLogger(__name__) - -FILE_SERVER_URL = os.environ.get("FILE_SERVER_URL", None) -FILE_SERVER_TIMEOUT = int(os.environ.get("FILE_SERVER_TIMEOUT", 30)) - - -def find_and_download_docs_if_needed(dialog, model_needs_train, filepaths_in_container, docs_and_links): - if "human_attributes" in dialog: - document_links_in_attr = dialog.get("human_attributes", [{}])[-1].get("documents", []) # new docs - processed_docs = dialog.get("bot", {}).get("attributes", {}).get("document_links", []) - if document_links_in_attr != processed_docs: - model_needs_train = True - download_files_and_save_links(document_links_in_attr, filepaths_in_container, docs_and_links) - else: - logger.info("No documents found anywhere.") - return document_links_in_attr, model_needs_train - - -def train_upload_return_attributes( - config, filepaths_in_container, document_links, docs_and_links, doc_needs_upload=False -): - logger.info("Started training model.") - build_dataset_and_train_model( - config, "/data/temporary_dataset/", filepaths_in_container - ) # filepaths_in_container are used to create a database to work with - logger.info("Started writing model files to server.") - model_id, db_link, matrix_link = upload_model_return_id_and_links( - "/data/odqa/userfile.db", "/data/odqa/userfile_tfidf_matrix.npz" - ) - if doc_needs_upload: # only if doc is not already on fileserver - document_links = upload_files_return_links(filepaths_in_container) - time.sleep(1) - bot_and_human_atts = { - "bot_attributes": { - "db_link": db_link, # todo: maybe replace db_link and matrix_link with model_id - "matrix_link": matrix_link, - "document_links": document_links, - }, - "human_attributes": { - "documents_qa_model": { - "model_id": model_id, - "document_ids_and_info": docs_and_links, - "document_links": document_links, - } - }, - } - return bot_and_human_atts - - -def upload_model_return_id_and_links(db_file, matrix_file): - model_id = generate_random_string(10) - db_link = upload_document(f"{model_id}.db", db_file, FILE_SERVER_URL) - matrix_link = upload_document(f"{model_id}.npz", matrix_file, FILE_SERVER_URL) - return model_id, db_link, matrix_link - - -def upload_files_return_links(filepaths_in_container): - document_links = [] - for filepath in filepaths_in_container: - new_filename = PurePath(filepath).name - # file already has a random-id name (assigned earlier), so we just get it - document_link = upload_document(new_filename, filepath, FILE_SERVER_URL) - document_links.append(document_link) - # save all the links to relevant files on server - # todo: in the future add to folder on server!!! - return document_links - - -def create_folders_if_not_exist(folders_list): - for folder in folders_list: - if not os.path.exists(folder): - os.mkdir(folder) - - -def remove_files_and_folders(files_list, folders_list): - for file in files_list: - os.remove(file) - for folder in folders_list: - shutil.rmtree(folder, ignore_errors=True) - logger.info("Files successfully written to server. Everyting removed from /data.") - - -def download_files_and_save_links(document_links, filepaths_in_container, docs_and_links): - for link in document_links: - filepath_in_container = download_file_to_data(link) - filepaths_in_container.append(filepath_in_container) - # we download all incoming files to /data and save paths - docs_and_links.append( - { - "document_id": PurePath(link).stem, - "initial_path_or_link": link, - } - ) # linking ids and initial file information - - -def move_files_and_save_paths(document_paths, filepaths_in_container, docs_and_links): - for filepath in document_paths: - file_id = generate_random_string(10) - filepath_in_container = f"/data/documents/{file_id}.txt" - orig_file_text = get_text_from_filepath(filepath) - with open(filepath_in_container, "w") as f: - f.write(orig_file_text) - # move all the files to /data (for uniformness all files are always stored there) - docs_and_links.append( - { - "document_id": PurePath(filepath_in_container).stem, - "initial_path_or_link": filepath, - } - ) # linking ids and initial filenames - filepaths_in_container.append(filepath_in_container) # save paths - - -def pdf_to_text(file): - pdf = pdfium.PdfDocument(file) # supports file path strings, bytes, and byte buffers - n_pages = len(pdf) - full_doc_text = "" - for page in range(n_pages): - page_index = pdf[page] - textpage = page_index.get_textpage() - text_all = textpage.get_text_range() - full_doc_text += text_all - return full_doc_text - - -def html_to_text(file): - soup = BeautifulSoup(file) - full_doc_text = soup.get_text(strip=True) - return full_doc_text - - -def get_text_from_filepath(filepath: str) -> str: - file_extension = PurePath(filepath).suffix - if "pdf" in file_extension: - full_doc_text = pdf_to_text(filepath) - elif "html" in file_extension: - with open(filepath, "r") as f: - html_doc = f.read() - full_doc_text = html_to_text(html_doc) - else: - with open(filepath, "r") as f: - full_doc_text = f.read() - return full_doc_text - - -def get_text_from_fileobject(file_object: str, file_extension: str) -> str: - if "pdf" in file_extension: - full_doc_text = pdf_to_text(file_object.content) - elif "html" in file_extension: - full_doc_text = html_to_text(file_object.text) - else: - full_doc_text = file_object.text - return full_doc_text - - -def generate_random_string(length: int) -> str: - characters = string.ascii_letters + string.digits - return "".join(random.choice(characters) for _ in range(length)) - - -def download_file_to_data(filepath: str) -> str: - file_id = generate_random_string(10) - file_extension = PurePath(filepath).suffix - filepath_in_container = f"/data/documents/{file_id}.txt" - orig_file = requests.get(filepath, timeout=FILE_SERVER_TIMEOUT) - orig_file_text = get_text_from_fileobject(orig_file, file_extension) - with open(filepath_in_container, "w") as f: - f.write(orig_file_text) - return filepath_in_container - - -def upload_document(filename, filepath, file_server_url): - server_url = urlparse(file_server_url) - resp = requests.post(file_server_url, files={"file": (filename, open(filepath, "rb"))}, timeout=30) - resp.raise_for_status() - download_link = resp.json()["downloadLink"] - download_link = urlparse(download_link)._replace(scheme=server_url.scheme, netloc=server_url.netloc).geturl() - return download_link - - -def build_dataset_and_train_model(model_config, dataset_path, doc_path_or_link): - print("Model is not trained.\nLet's train the model!\n\n") - build_dataset(dataset_path, doc_path_or_link) - print("Dataset built. Now training the model.") - train_model(model_config) - print("Model is trained.") From f4c3b6b556a895627489eec6f96fe37483f24a75 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 16:09:47 +0300 Subject: [PATCH 14/35] test file for fact checking --- annotators/fact_checking/test.py | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 annotators/fact_checking/test.py diff --git a/annotators/fact_checking/test.py b/annotators/fact_checking/test.py new file mode 100644 index 0000000000..a2718e8232 --- /dev/null +++ b/annotators/fact_checking/test.py @@ -0,0 +1,34 @@ +import requests + + +def main(): + url = f"http://0.0.0.0:8182/respond" + result = requests.post( + url=url, + json={ + "hypotheses": [ + { + "skill_name": "dff_google_api_skill", + "text": "Jack is 5 years old." + }, + { + "skill_name": "dff_dream_persona_chatgpt_prompted_skill", + "text": "Jack is 25 years old.", + }, + { + "skill_name": "dummy_skill", + "text": "Sorry, I cannot answer your question.", + }, + ], + "human_uttr_attributes": [{}, {}, {}], + }, + ) + print(result.json()) + result = result.json()[0]["batch"] + result_gold = ["Correct", "Incorrect", "Correct"] + assert result == result_gold, f"Got\n{result}\n, something is wrong" + print("Success!") + + +if __name__ == "__main__": + main() From eab10176ffce4a14576668a43a08f9be40fdec34 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 16:10:33 +0300 Subject: [PATCH 15/35] moved SKILLS_NOT_TO_FACT_CHECK, updated README for response selector --- common/response_selection.py | 5 +++++ response_selectors/ranking_based_response_selector/README.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/response_selection.py b/common/response_selection.py index 3a61debebe..fabcc90a2c 100644 --- a/common/response_selection.py +++ b/common/response_selection.py @@ -68,3 +68,8 @@ "Oh, before I forget,", "I wanted to mention that,", ] + +SKILLS_NOT_TO_FACT_CHECK = [ + "dummy_skill", + "dff_intent_responder_skill" +] \ No newline at end of file diff --git a/response_selectors/ranking_based_response_selector/README.md b/response_selectors/ranking_based_response_selector/README.md index 9a9f01055d..a5c9bc157f 100644 --- a/response_selectors/ranking_based_response_selector/README.md +++ b/response_selectors/ranking_based_response_selector/README.md @@ -19,4 +19,4 @@ Parameter `ENABLE_FACT_CHECKING` defines whether to filter out factually incorre ## Dependencies - either candidate annotations by `SENTENCE_RANKER_ANNOTATION_NAME` or service `SENTENCE_RANKER_SERVICE_URL` -- __if `ENABLE_FACT_CHECKING=1`:__ candidate annotations by `FACTUAL_CONFORMITY_ANNOTATION_NAME` or service `FACTUAL_CONFORMITY_SERVICE_URL` \ No newline at end of file +- __only if `ENABLE_FACT_CHECKING=1`:__ either candidate annotations by `FACTUAL_CONFORMITY_ANNOTATION_NAME` or service `FACTUAL_CONFORMITY_SERVICE_URL` \ No newline at end of file From 11094d11822a65f142116f8ef6099c10bb0c42c9 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 16:40:51 +0300 Subject: [PATCH 16/35] add README.md for annotator --- annotators/fact_checking/README.md | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/annotators/fact_checking/README.md b/annotators/fact_checking/README.md index df2235345c..f80f328d1b 100644 --- a/annotators/fact_checking/README.md +++ b/annotators/fact_checking/README.md @@ -1,22 +1,17 @@ -# Document Retriever +# Fact Checking ## Description -Document Retriever is an annotator with two endpoints used to retrieve `PARAGRAPHS_NUM` document parts most relevant to the user request. +Fact Checking conducts basic fact-checking of response candidates. As of now, it considers all hypotheses derived from external sources correct (skills relying on external sources are listed in `EXTERNAL_SKILLS`). Internally generated hypotheses are fact-checked by ensuring that they do not contradict any of the external hypotheses. For example, if `dff_google_api_skill` that relies on Google as a source of external knowledge responds _"Person X is 25 years old"_ and some solely LLM-based skill provides a hallucinated responds _"Person X is 23 years old"_, the second hypotheses is considered incorrect as it contradicts the first, external one. -1. **train_and_upload_model** endpoint converts the documents provided by the user to txt format (if necessary) and splits them into chunks of ~100 words. Chunks are then transformed into a TF-IDF matrix; the resulting vectors and the vectorizer are saved for future use. This step is performed only once, in the beginning of the dialog. -Documents (txt format), matrix, and vectorizer are uploaded to file server to be used by **return_candidates** endpoint and **dff_document_qa_llm** skill. -2. **return_candidates** endpoint downloads TF-IDF matrix and vectorizer from the file server. It then converts the user’s utterance into a TF-IDF vector and finds `PARAGRAPHS_NUM` candidates with highest cosine similarity among TF-IDF vectors of text chunks. +NB: Scripted responses from `dummy_skill` and `dff_intent_responder_skill` are not fact-checked for the sake of efficiency and are always deemed correct. ## Parameters ``` -CONFIG_PATH: configuration file with parameters for doc_retriever model -FILE_SERVER_TIMEOUT: timeout for request where files are stored -PARAGRAPHS_NUM: number of most relevant chunks to retrieve. Don't make this number too large or the chunks won't fit into LLM context! -DOC_PATH_OR_LINK: paths or link to the files to be use for Question Answering. If paths, those are paths to files in `documents` folder in dream. If links, those must point to a file, not an Internet page. NB: file paths/links must be separated by a comma and no whitespace. +ENVVARS_TO_SEND: API keys splitted by comma to get as env variables +GENERATIVE_SERVICE_URL: LLM to utilize for fact-checking +GENERATIVE_TIMEOUT: timeout for the request to LLM +GENERATIVE_SERVICE_CONFIG: configuration file with generative parameters to utilize +EXTERNAL_SKILLS: list of skills that generate hypotheses based on external knowledge; these skills are considered correct and the other hypotheses are checked upon them ``` - -## Dependencies - -- **return_candidates** endpoint depends on **train_and_upload_model** endpoint \ No newline at end of file From add0a27e8bab31d98fba78a23ccbe728319f7452 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 16:41:24 +0300 Subject: [PATCH 17/35] code style & moved SKILLS_NOT_TO_FACT_CHECK --- annotators/fact_checking/server.py | 24 ++++++++++++++++-------- annotators/fact_checking/test.py | 8 ++------ common/response_selection.py | 5 ----- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/annotators/fact_checking/server.py b/annotators/fact_checking/server.py index 6ced8e48e6..cb85476f13 100644 --- a/annotators/fact_checking/server.py +++ b/annotators/fact_checking/server.py @@ -19,11 +19,12 @@ EXTERNAL_SKILLS = getenv("EXTERNAL_SKILLS", None) EXTERNAL_SKILLS = [] if EXTERNAL_SKILLS is None else EXTERNAL_SKILLS.split(",") GENERATIVE_SERVICE_URL = getenv("GENERATIVE_SERVICE_URL") -GENERATIVE_TIMEOUT = int(getenv("GENERATIVE_TIMEOUT", 0)) +GENERATIVE_TIMEOUT = int(getenv("GENERATIVE_TIMEOUT")) GENERATIVE_SERVICE_CONFIG = getenv("GENERATIVE_SERVICE_CONFIG") if GENERATIVE_SERVICE_CONFIG: with open(f"common/generative_configs/{GENERATIVE_SERVICE_CONFIG}", "r") as f: GENERATIVE_SERVICE_CONFIG = json.load(f) +SKILLS_NOT_TO_FACT_CHECK = ["dummy_skill", "dff_intent_responder_skill"] def check_hyp_with_llm(curr_prompt, human_uttr_attr): @@ -36,7 +37,7 @@ def check_hyp_with_llm(curr_prompt, human_uttr_attr): **human_uttr_attr, ) response = send_request_to_prompted_generative_service( - "", # нужен ли нам контекст и какой длины? + "", # нужен ли нам контекст и какой длины? curr_prompt, GENERATIVE_SERVICE_URL, GENERATIVE_SERVICE_CONFIG, @@ -44,7 +45,7 @@ def check_hyp_with_llm(curr_prompt, human_uttr_attr): sending_variables, ) result = response[0] - if 'yes' in result.lower(): + if "yes" in result.lower(): _is_hyp_correct = False else: _is_hyp_correct = True @@ -56,7 +57,9 @@ def respond(): hypotheses = request.json["hypotheses"] human_uttr_attributes = request.json["human_uttr_attributes"] ie_types = ["external" if hyp["skill_name"] in EXTERNAL_SKILLS else "internal" for hyp in hypotheses] - external_service_hyps = [(hyp["text"], hyp["skill_name"]) for hyp in hypotheses if hyp["skill_name"] in EXTERNAL_SKILLS] + external_service_hyps = [ + (hyp["text"], hyp["skill_name"]) for hyp in hypotheses if hyp["skill_name"] in EXTERNAL_SKILLS + ] results = [] for hyp, human_uttr_attr, ie_type in zip(hypotheses, human_uttr_attributes, ie_types): hyp_text = hyp["text"] @@ -68,8 +71,11 @@ def respond(): logger.info(f"Hypothesis `{hyp_text}` is not checked as it was produced by {hyp['skill_name']}.") results += ["Correct"] else: - if len(external_service_hyps) == 0: - logger.info(f"Hypothesis `{hyp_text}` is considered correct as there are no external hypotheses to check it upon.") + if len(external_service_hyps) == 0: + logger.info( + f"Hypothesis `{hyp_text}` is considered correct as there are no external hypotheses\ +to check it upon." + ) results += ["Correct"] else: _is_hyp_correct = True @@ -80,8 +86,10 @@ def respond(): _is_hyp_correct_one_step = check_hyp_with_llm(curr_prompt, human_uttr_attr) if not _is_hyp_correct_one_step: _is_hyp_correct = False - logger.info(f"""Internal hypothesis `{hyp_text}` is incorrect according to external service \ -{external_service_name}.""") + logger.info( + f"""Internal hypothesis `{hyp_text}` is incorrect according to external service \ +{external_service_name}.""" + ) results += ["Incorrect"] break if _is_hyp_correct: diff --git a/annotators/fact_checking/test.py b/annotators/fact_checking/test.py index a2718e8232..51325e2017 100644 --- a/annotators/fact_checking/test.py +++ b/annotators/fact_checking/test.py @@ -2,15 +2,12 @@ def main(): - url = f"http://0.0.0.0:8182/respond" + url = "http://0.0.0.0:8182/respond" result = requests.post( url=url, json={ "hypotheses": [ - { - "skill_name": "dff_google_api_skill", - "text": "Jack is 5 years old." - }, + {"skill_name": "dff_google_api_skill", "text": "Jack is 5 years old."}, { "skill_name": "dff_dream_persona_chatgpt_prompted_skill", "text": "Jack is 25 years old.", @@ -23,7 +20,6 @@ def main(): "human_uttr_attributes": [{}, {}, {}], }, ) - print(result.json()) result = result.json()[0]["batch"] result_gold = ["Correct", "Incorrect", "Correct"] assert result == result_gold, f"Got\n{result}\n, something is wrong" diff --git a/common/response_selection.py b/common/response_selection.py index fabcc90a2c..3a61debebe 100644 --- a/common/response_selection.py +++ b/common/response_selection.py @@ -68,8 +68,3 @@ "Oh, before I forget,", "I wanted to mention that,", ] - -SKILLS_NOT_TO_FACT_CHECK = [ - "dummy_skill", - "dff_intent_responder_skill" -] \ No newline at end of file From 0524a728fb70d3014b0f5182ea1a08da9a4a8fbe Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 16:44:47 +0300 Subject: [PATCH 18/35] moving EXTERNAL_SKILLS from args to common --- annotators/fact_checking/README.md | 3 +-- annotators/fact_checking/server.py | 4 +--- common/response_selection.py | 2 ++ response_selectors/llm_based_response_selector/server.py | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/annotators/fact_checking/README.md b/annotators/fact_checking/README.md index f80f328d1b..ef51a2a8ae 100644 --- a/annotators/fact_checking/README.md +++ b/annotators/fact_checking/README.md @@ -2,7 +2,7 @@ ## Description -Fact Checking conducts basic fact-checking of response candidates. As of now, it considers all hypotheses derived from external sources correct (skills relying on external sources are listed in `EXTERNAL_SKILLS`). Internally generated hypotheses are fact-checked by ensuring that they do not contradict any of the external hypotheses. For example, if `dff_google_api_skill` that relies on Google as a source of external knowledge responds _"Person X is 25 years old"_ and some solely LLM-based skill provides a hallucinated responds _"Person X is 23 years old"_, the second hypotheses is considered incorrect as it contradicts the first, external one. +Fact Checking conducts basic fact-checking of response candidates. As of now, it considers all hypotheses derived from external sources correct. Internally generated hypotheses are fact-checked by ensuring that they do not contradict any of the external hypotheses. For example, if `dff_google_api_skill` that relies on Google as a source of external knowledge responds _"Person X is 25 years old"_ and some solely LLM-based skill provides a hallucinated responds _"Person X is 23 years old"_, the second hypotheses is considered incorrect as it contradicts the first, external one. NB: Scripted responses from `dummy_skill` and `dff_intent_responder_skill` are not fact-checked for the sake of efficiency and are always deemed correct. @@ -13,5 +13,4 @@ ENVVARS_TO_SEND: API keys splitted by comma to get as env variables GENERATIVE_SERVICE_URL: LLM to utilize for fact-checking GENERATIVE_TIMEOUT: timeout for the request to LLM GENERATIVE_SERVICE_CONFIG: configuration file with generative parameters to utilize -EXTERNAL_SKILLS: list of skills that generate hypotheses based on external knowledge; these skills are considered correct and the other hypotheses are checked upon them ``` diff --git a/annotators/fact_checking/server.py b/annotators/fact_checking/server.py index cb85476f13..9327b808aa 100644 --- a/annotators/fact_checking/server.py +++ b/annotators/fact_checking/server.py @@ -5,7 +5,7 @@ from flask import Flask, jsonify, request from sentry_sdk.integrations.flask import FlaskIntegration from common.prompts import send_request_to_prompted_generative_service, compose_sending_variables -from common.response_selection import SKILLS_NOT_TO_FACT_CHECK +from common.response_selection import EXTERNAL_SKILLS # logging here because it conflicts with tf @@ -16,8 +16,6 @@ ENVVARS_TO_SEND = getenv("ENVVARS_TO_SEND", None) ENVVARS_TO_SEND = [] if ENVVARS_TO_SEND is None else ENVVARS_TO_SEND.split(",") -EXTERNAL_SKILLS = getenv("EXTERNAL_SKILLS", None) -EXTERNAL_SKILLS = [] if EXTERNAL_SKILLS is None else EXTERNAL_SKILLS.split(",") GENERATIVE_SERVICE_URL = getenv("GENERATIVE_SERVICE_URL") GENERATIVE_TIMEOUT = int(getenv("GENERATIVE_TIMEOUT")) GENERATIVE_SERVICE_CONFIG = getenv("GENERATIVE_SERVICE_CONFIG") diff --git a/common/response_selection.py b/common/response_selection.py index 3a61debebe..f8a4824d8c 100644 --- a/common/response_selection.py +++ b/common/response_selection.py @@ -68,3 +68,5 @@ "Oh, before I forget,", "I wanted to mention that,", ] + +EXTERNAL_SKILLS = ["factoid_qa", "dff_google_api_skill"] \ No newline at end of file diff --git a/response_selectors/llm_based_response_selector/server.py b/response_selectors/llm_based_response_selector/server.py index 0c88502972..df48fef025 100644 --- a/response_selectors/llm_based_response_selector/server.py +++ b/response_selectors/llm_based_response_selector/server.py @@ -12,6 +12,7 @@ from flask import Flask, request, jsonify from common.prompts import send_request_to_prompted_generative_service, compose_sending_variables from common.utils import is_toxic_or_badlisted_utterance +from common.response_selection import EXTERNAL_SKILLS sentry_sdk.init(getenv("SENTRY_DSN")) @@ -38,7 +39,6 @@ ) ENVVARS_TO_SEND = getenv("ENVVARS_TO_SEND", None) ENVVARS_TO_SEND = [] if ENVVARS_TO_SEND is None else ENVVARS_TO_SEND.split(",") -EXTERNAL_SKILLS = ["factoid_qa", "dff_google_api_skill"] assert GENERATIVE_SERVICE_URL From 722d187aed12afc7d6e154d57faee44f9bfc834b Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 16:46:27 +0300 Subject: [PATCH 19/35] moving EXTERNAL_SKILLS from args to common again --- annotators/fact_checking/Dockerfile | 2 -- assistant_dists/dream/docker-compose.override.yml | 1 - 2 files changed, 3 deletions(-) diff --git a/annotators/fact_checking/Dockerfile b/annotators/fact_checking/Dockerfile index 6d243d41e6..5524df6a83 100644 --- a/annotators/fact_checking/Dockerfile +++ b/annotators/fact_checking/Dockerfile @@ -10,8 +10,6 @@ ARG GENERATIVE_TIMEOUT ENV GENERATIVE_TIMEOUT ${GENERATIVE_TIMEOUT} ARG GENERATIVE_SERVICE_CONFIG ENV GENERATIVE_SERVICE_CONFIG ${GENERATIVE_SERVICE_CONFIG} -ARG EXTERNAL_SKILLS -ENV EXTERNAL_SKILLS ${EXTERNAL_SKILLS} ARG ENVVARS_TO_SEND ENV ENVVARS_TO_SEND ${ENVVARS_TO_SEND} diff --git a/assistant_dists/dream/docker-compose.override.yml b/assistant_dists/dream/docker-compose.override.yml index 3b20b4252f..abed53478f 100644 --- a/assistant_dists/dream/docker-compose.override.yml +++ b/assistant_dists/dream/docker-compose.override.yml @@ -495,7 +495,6 @@ services: GENERATIVE_TIMEOUT: 10 GENERATIVE_SERVICE_CONFIG: openai-chatgpt.json ENVVARS_TO_SEND: OPENAI_API_KEY,OPENAI_ORGANIZATION - EXTERNAL_SKILLS: factoid_qa,dff_google_api_skill context: . dockerfile: annotators/fact_checking/Dockerfile command: flask run -h 0.0.0.0 -p 8182 From 0e7e441664426cf7e5146a1f3df6aaab95b6718e Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 17:20:24 +0300 Subject: [PATCH 20/35] improve logging and make SERVICE_PORT an arg --- annotators/fact_checking/Dockerfile | 4 +++- annotators/fact_checking/server.py | 8 ++++---- annotators/fact_checking/test.py | 4 +++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/annotators/fact_checking/Dockerfile b/annotators/fact_checking/Dockerfile index 5524df6a83..d9f33642a5 100644 --- a/annotators/fact_checking/Dockerfile +++ b/annotators/fact_checking/Dockerfile @@ -4,9 +4,11 @@ WORKDIR /src COPY annotators/fact_checking/requirements.txt /src/requirements.txt RUN pip install -r /src/requirements.txt +ARG SERVICE_PORT +ENV SERVICE_PORT ${SERVICE_PORT} ARG GENERATIVE_SERVICE_URL ENV GENERATIVE_SERVICE_URL ${GENERATIVE_SERVICE_URL} -ARG GENERATIVE_TIMEOUT +ARG GENERATIVE_TIMEOUT=5 ENV GENERATIVE_TIMEOUT ${GENERATIVE_TIMEOUT} ARG GENERATIVE_SERVICE_CONFIG ENV GENERATIVE_SERVICE_CONFIG ${GENERATIVE_SERVICE_CONFIG} diff --git a/annotators/fact_checking/server.py b/annotators/fact_checking/server.py index 9327b808aa..1cf77b7214 100644 --- a/annotators/fact_checking/server.py +++ b/annotators/fact_checking/server.py @@ -35,7 +35,7 @@ def check_hyp_with_llm(curr_prompt, human_uttr_attr): **human_uttr_attr, ) response = send_request_to_prompted_generative_service( - "", # нужен ли нам контекст и какой длины? + "", curr_prompt, GENERATIVE_SERVICE_URL, GENERATIVE_SERVICE_CONFIG, @@ -50,8 +50,8 @@ def check_hyp_with_llm(curr_prompt, human_uttr_attr): return _is_hyp_correct -@app.route("/respond", methods=["POST"]) -def respond(): +@app.route("/respond_batch", methods=["POST"]) +def respond_batch(): hypotheses = request.json["hypotheses"] human_uttr_attributes = request.json["human_uttr_attributes"] ie_types = ["external" if hyp["skill_name"] in EXTERNAL_SKILLS else "internal" for hyp in hypotheses] @@ -71,7 +71,7 @@ def respond(): else: if len(external_service_hyps) == 0: logger.info( - f"Hypothesis `{hyp_text}` is considered correct as there are no external hypotheses\ + f"Internal hypothesis `{hyp_text}` is considered correct as there are no external hypotheses \ to check it upon." ) results += ["Correct"] diff --git a/annotators/fact_checking/test.py b/annotators/fact_checking/test.py index 51325e2017..edb2dfcc99 100644 --- a/annotators/fact_checking/test.py +++ b/annotators/fact_checking/test.py @@ -1,8 +1,10 @@ import requests +from os import getenv +SERVICE_PORT = getenv("SERVICE_PORT") def main(): - url = "http://0.0.0.0:8182/respond" + url = f"http://0.0.0.0:{SERVICE_PORT}/respond_batch" result = requests.post( url=url, json={ From fd5943af73990219984c1a56dad9835833d1a12e Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 17:20:57 +0300 Subject: [PATCH 21/35] component cards for annotator --- .../doc-retriever/environment.yml | 8 ----- .../service_configs/doc-retriever/service.yml | 34 ------------------- .../fact-checking/environment.yml | 6 ++++ .../service_configs/fact-checking/service.yml | 30 ++++++++++++++++ 4 files changed, 36 insertions(+), 42 deletions(-) delete mode 100644 annotators/fact_checking/service_configs/doc-retriever/environment.yml delete mode 100644 annotators/fact_checking/service_configs/doc-retriever/service.yml create mode 100644 annotators/fact_checking/service_configs/fact-checking/environment.yml create mode 100644 annotators/fact_checking/service_configs/fact-checking/service.yml diff --git a/annotators/fact_checking/service_configs/doc-retriever/environment.yml b/annotators/fact_checking/service_configs/doc-retriever/environment.yml deleted file mode 100644 index 3964508e56..0000000000 --- a/annotators/fact_checking/service_configs/doc-retriever/environment.yml +++ /dev/null @@ -1,8 +0,0 @@ -SERVICE_PORT: 8165 -SERVICE_NAME: doc_retriever -CONFIG_PATH: ./doc_retriever_config.json -DOC_PATH_OR_LINK: http://files.deeppavlov.ai/dream_data/documents_for_qa/test_file_dream_repo.html,http://files.deeppavlov.ai/dream_data/documents_for_qa/alphabet_financial_report.txt,http://files.deeppavlov.ai/dream_data/documents_for_qa/test_file_jurafsky_chatbots.pdf -PARAGRAPHS_NUM: 5 -FILE_SERVER_TIMEOUT: 30 -CUDA_VISIBLE_DEVICES: '0' -FLASK_APP: server diff --git a/annotators/fact_checking/service_configs/doc-retriever/service.yml b/annotators/fact_checking/service_configs/doc-retriever/service.yml deleted file mode 100644 index a53aa796d9..0000000000 --- a/annotators/fact_checking/service_configs/doc-retriever/service.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: doc-retriever -endpoints: - - train_and_upload_model - - return_candidates -compose: - env_file: - - .env - build: - args: - SERVICE_PORT: 8165 - SERVICE_NAME: doc_retriever - CONFIG_PATH: ./doc_retriever_config.json - DOC_PATH_OR_LINK: http://files.deeppavlov.ai/dream_data/documents_for_qa/test_file_dream_repo.html,http://files.deeppavlov.ai/dream_data/documents_for_qa/alphabet_financial_report.txt,http://files.deeppavlov.ai/dream_data/documents_for_qa/test_file_jurafsky_chatbots.pdf - PARAGRAPHS_NUM: 5 - FILE_SERVER_TIMEOUT: 30 - context: . - dockerfile: annotators/doc_retriever/Dockerfile - command: flask run -h 0.0.0.0 -p 8165 - environment: - - CUDA_VISIBLE_DEVICES=0 - - FLASK_APP=server - deploy: - resources: - limits: - memory: 5G - reservations: - memory: 5G - volumes: - - "./annotators/doc_retriever:/src" - - "./common:/src/common" - - "./documents:/src/documents" - ports: - - 8165:8165 -proxy: null diff --git a/annotators/fact_checking/service_configs/fact-checking/environment.yml b/annotators/fact_checking/service_configs/fact-checking/environment.yml new file mode 100644 index 0000000000..008f1e7671 --- /dev/null +++ b/annotators/fact_checking/service_configs/fact-checking/environment.yml @@ -0,0 +1,6 @@ +SERVICE_PORT: 8182 +GENERATIVE_SERVICE_URL: http://openai-api-chatgpt:8145/respond +GENERATIVE_TIMEOUT: 5 +GENERATIVE_SERVICE_CONFIG: openai-chatgpt.json +ENVVARS_TO_SEND: OPENAI_API_KEY,OPENAI_ORGANIZATION +FLASK_APP: server diff --git a/annotators/fact_checking/service_configs/fact-checking/service.yml b/annotators/fact_checking/service_configs/fact-checking/service.yml new file mode 100644 index 0000000000..c352429862 --- /dev/null +++ b/annotators/fact_checking/service_configs/fact-checking/service.yml @@ -0,0 +1,30 @@ +name: fact-checking +endpoints: + - respond_batch +compose: + env_file: + - .env, .env_secret + build: + args: + SERVICE_PORT: 8182 + GENERATIVE_SERVICE_URL: http://openai-api-chatgpt:8145/respond + GENERATIVE_TIMEOUT: 5 + GENERATIVE_SERVICE_CONFIG: openai-chatgpt.json + ENVVARS_TO_SEND: OPENAI_API_KEY,OPENAI_ORGANIZATION + context: . + dockerfile: annotators/fact_checking/Dockerfile + command: flask run -h 0.0.0.0 -p 8182 + environment: + - FLASK_APP=server + deploy: + resources: + limits: + memory: 128M + reservations: + memory: 128M + volumes: + - "./annotators/fact_checking:/src" + - "./common:/src/common" + ports: + - 8182:8182 +proxy: null From a9772b5eca75300c8004f240b4f7c629872f04a9 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 17:22:14 +0300 Subject: [PATCH 22/35] component cards for fact-checking annotator and ranking-based-response-selector-fact-checking --- .../dream/docker-compose.override.yml | 2 +- assistant_dists/dream/pipeline_conf.json | 10 +++--- components/dvpefjoPOHC90efoi.yml | 25 ++++++++++++++ components/oijrtOIfj94jnvkf30n.yml | 26 ++++++++++++++ .../environment.yml | 12 +++++++ .../service.yml | 34 +++++++++++++++++++ 6 files changed, 103 insertions(+), 6 deletions(-) create mode 100644 components/dvpefjoPOHC90efoi.yml create mode 100644 components/oijrtOIfj94jnvkf30n.yml create mode 100644 response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking/environment.yml create mode 100644 response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking/service.yml diff --git a/assistant_dists/dream/docker-compose.override.yml b/assistant_dists/dream/docker-compose.override.yml index abed53478f..9ab0a70386 100644 --- a/assistant_dists/dream/docker-compose.override.yml +++ b/assistant_dists/dream/docker-compose.override.yml @@ -492,7 +492,7 @@ services: build: args: GENERATIVE_SERVICE_URL: http://openai-api-chatgpt:8145/respond - GENERATIVE_TIMEOUT: 10 + GENERATIVE_TIMEOUT: 5 GENERATIVE_SERVICE_CONFIG: openai-chatgpt.json ENVVARS_TO_SEND: OPENAI_API_KEY,OPENAI_ORGANIZATION context: . diff --git a/assistant_dists/dream/pipeline_conf.json b/assistant_dists/dream/pipeline_conf.json index bae3e9955c..01ad89795f 100644 --- a/assistant_dists/dream/pipeline_conf.json +++ b/assistant_dists/dream/pipeline_conf.json @@ -399,8 +399,8 @@ "fact_checking": { "connector": { "protocol": "http", - "timeout": 2.0, - "url": "http://fact-checking:8182/respond" + "timeout": 5.0, + "url": "http://fact-checking:8182/respond_batch" }, "dialog_formatter": "state_formatters.dp_formatters:hypotheses_and_attributes", "response_formatter": "state_formatters.dp_formatters:simple_formatter_service", @@ -410,7 +410,7 @@ "state_manager_method": "add_hypothesis_annotation_batch", "is_enabled": true, "source": { - "component": "components/LKHNon389plcdknoiefh.yml", + "component": "components/oijrtOIfj94jnvkf30n.yml", "service": "annotators/fact_checking/service_configs/fact-checking" } } @@ -569,8 +569,8 @@ "state_manager_method": "add_bot_utterance", "is_enabled": true, "source": { - "component": "components/YJzc7NwGrLmKp6gfZJh7X1.yml", - "service": "response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector" + "component": "components/dvpefjoPOHC90efoi.yml", + "service": "response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking" } } } diff --git a/components/dvpefjoPOHC90efoi.yml b/components/dvpefjoPOHC90efoi.yml new file mode 100644 index 0000000000..97be9652a7 --- /dev/null +++ b/components/dvpefjoPOHC90efoi.yml @@ -0,0 +1,25 @@ +name: response_selector +display_name: Response Selector (Fact-Checking enables) +component_type: null +model_type: Dictionary/Pattern-based +is_customizable: false +author: publisher@deeppavlov.ai +description: Algorithm that selects the final response among the given list of candidate + responses via the given ranking service and the given fact-checking service. +ram_usage: 100M +gpu_usage: null +group: response_selectors +connector: + protocol: http + timeout: 1.0 + url: http://ranking-based-response-selector:8002/respond +dialog_formatter: state_formatters.dp_formatters:cropped_dialog +response_formatter: state_formatters.dp_formatters:base_response_selector_formatter_service +previous_services: +- candidate_annotators +required_previous_services: null +state_manager_method: add_bot_utterance +tags: null +endpoint: respond +service: response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking +date_created: '2023-03-16T09:45:32' \ No newline at end of file diff --git a/components/oijrtOIfj94jnvkf30n.yml b/components/oijrtOIfj94jnvkf30n.yml new file mode 100644 index 0000000000..136f381386 --- /dev/null +++ b/components/oijrtOIfj94jnvkf30n.yml @@ -0,0 +1,26 @@ +name: fact_checking +display_name: Fact Checking +component_type: null +model_type: NN-based +is_customizable: false +author: publisher@deeppavlov.ai +description: Performs basic fact-checking of internal hypotheses + by using an LLM to determine whether they contradict any of the hypotheses + that rely on external knowledge sources. +ram_usage: 128M +gpu_usage: null +group: candidate_annotators +connector: + protocol: http + timeout: 5.0 + url: http://fact-checking:8182/respond_batch +dialog_formatter: state_formatters.dp_formatters:hypotheses_and_attributes +response_formatter: state_formatters.dp_formatters:simple_formatter_service +previous_services: +- skills +required_previous_services: null +state_manager_method: add_hypothesis_annotation_batch +tags: null +endpoint: respond_batch +service: annotators/fact_checking/service_configs/fact-checking +date_created: '2023-08-15T17:06:52' \ No newline at end of file diff --git a/response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking/environment.yml b/response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking/environment.yml new file mode 100644 index 0000000000..328ff706e4 --- /dev/null +++ b/response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking/environment.yml @@ -0,0 +1,12 @@ +SERVICE_PORT: 8002 +SERVICE_NAME: response_selector +SENTENCE_RANKER_ANNOTATION_NAME: sentence_ranker +SENTENCE_RANKER_SERVICE_URL: http://sentence-ranker:8128/respond +SENTENCE_RANKER_TIMEOUT: 3 +N_UTTERANCES_CONTEXT: 5 +ENABLE_FACT_CHECKING: 1 +FACTUAL_CONFORMITY_SERVICE_URL: http://fact-checking:8182/respond +FACTUAL_CONFORMITY_SERVICE_TIMEOUT: 5 +FACTUAL_CONFORMITY_ANNOTATION_NAME: fact_checking +FILTER_TOXIC_OR_BADLISTED: 1 +FLASK_APP: server diff --git a/response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking/service.yml b/response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking/service.yml new file mode 100644 index 0000000000..d2f8c1f737 --- /dev/null +++ b/response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking/service.yml @@ -0,0 +1,34 @@ +name: ranking-based-response-selector +endpoints: +- respond +compose: + env_file: [ .env ] + build: + args: + SERVICE_PORT: 8002 + SERVICE_NAME: response_selector + LANGUAGE: EN + SENTENCE_RANKER_ANNOTATION_NAME: sentence_ranker + SENTENCE_RANKER_SERVICE_URL: http://sentence-ranker:8128/respond + SENTENCE_RANKER_TIMEOUT: 3 + ENABLE_FACT_CHECKING: 1 + FACTUAL_CONFORMITY_SERVICE_URL: http://fact-checking:8182/respond + FACTUAL_CONFORMITY_SERVICE_TIMEOUT: 5 + FACTUAL_CONFORMITY_ANNOTATION_NAME: fact_checking + N_UTTERANCES_CONTEXT: 5 + FILTER_TOXIC_OR_BADLISTED: 1 + FLASK_APP: server + context: . + dockerfile: ./response_selectors/ranking_based_response_selector/Dockerfile + command: flask run -h 0.0.0.0 -p 8002 + environment: + - FLASK_APP=server + deploy: + resources: + limits: + memory: 100M + reservations: + memory: 100M + ports: + - 8002:8002 +proxy: null From 16bec6539c857d39435463ddd6d2e6874b8cdef9 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 17:32:07 +0300 Subject: [PATCH 23/35] codestyle upd --- annotators/fact_checking/test.py | 1 + common/response_selection.py | 2 +- .../ranking_based_response_selector/server.py | 17 +++++++++++------ state_formatters/dp_formatters.py | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/annotators/fact_checking/test.py b/annotators/fact_checking/test.py index edb2dfcc99..321ff7a91b 100644 --- a/annotators/fact_checking/test.py +++ b/annotators/fact_checking/test.py @@ -3,6 +3,7 @@ SERVICE_PORT = getenv("SERVICE_PORT") + def main(): url = f"http://0.0.0.0:{SERVICE_PORT}/respond_batch" result = requests.post( diff --git a/common/response_selection.py b/common/response_selection.py index f8a4824d8c..7066618e4f 100644 --- a/common/response_selection.py +++ b/common/response_selection.py @@ -69,4 +69,4 @@ "I wanted to mention that,", ] -EXTERNAL_SKILLS = ["factoid_qa", "dff_google_api_skill"] \ No newline at end of file +EXTERNAL_SKILLS = ["factoid_qa", "dff_google_api_skill"] diff --git a/response_selectors/ranking_based_response_selector/server.py b/response_selectors/ranking_based_response_selector/server.py index 8e80351aca..7b202fd150 100644 --- a/response_selectors/ranking_based_response_selector/server.py +++ b/response_selectors/ranking_based_response_selector/server.py @@ -34,8 +34,9 @@ ) if ENABLE_FACT_CHECKING: assert FACTUAL_CONFORMITY_ANNOTATION_NAME or FACTUAL_CONFORMITY_SERVICE_URL, logger.error( - "Fact-checker service URL or annotator name should be given" -) + "Fact-checker service URL or annotator name should be given" + ) + def filter_out_badlisted_or_toxic(hypotheses): clean_hypotheses = [] @@ -79,7 +80,9 @@ def get_scores(dialog_context, hypotheses): def filter_out_factually_incorrect(hypotheses, human_uttr_attributes): if all([FACTUAL_CONFORMITY_ANNOTATION_NAME in hyp.get("annotations", {}) for hyp in hypotheses]): - fact_check_result = [hyp.get("annotations", {}).get(FACTUAL_CONFORMITY_ANNOTATION_NAME, "Correct") for hyp in hypotheses] + fact_check_result = [ + hyp.get("annotations", {}).get(FACTUAL_CONFORMITY_ANNOTATION_NAME, "Correct") for hyp in hypotheses + ] logger.info(f"Got annotations from {FACTUAL_CONFORMITY_ANNOTATION_NAME}.") else: try: @@ -95,11 +98,13 @@ def filter_out_factually_incorrect(hypotheses, human_uttr_attributes): fact_check_result = ["Correct" for _ in hypotheses] logger.exception(e) logger.info("Error. Marking all hypotheses as correct.") - clean_hypotheses = [hyp for hyp, res in zip(hypotheses, fact_check_result) if res =='Correct'] + clean_hypotheses = [hyp for hyp, res in zip(hypotheses, fact_check_result) if res == "Correct"] hypotheses_text = [hyp["text"] for hyp in hypotheses] clean_hypotheses_text = [hyp["text"] for hyp in clean_hypotheses] - logger.info(f"""Filtered out incorrect candidates: {'; '.join(set(hypotheses_text) - set(clean_hypotheses_text))} -Remaining candidates: {clean_hypotheses_text}""") + logger.info( + f"""Filtered out incorrect candidates: {'; '.join(set(hypotheses_text) - set(clean_hypotheses_text))} +Remaining candidates: {clean_hypotheses_text}""" + ) return clean_hypotheses diff --git a/state_formatters/dp_formatters.py b/state_formatters/dp_formatters.py index 5c052916ff..4133f421c1 100755 --- a/state_formatters/dp_formatters.py +++ b/state_formatters/dp_formatters.py @@ -558,7 +558,7 @@ def persona_bot_formatter(dialog: Dict): def cropped_dialog(dialog: Dict): - with open('test_cand_ann.json', 'w', encoding='utf-8') as f: + with open("test_cand_ann.json", "w", encoding="utf-8") as f: json.dump(dialog, f, ensure_ascii=False, indent=4) dialog = utils.get_last_n_turns(dialog) dialog = utils.remove_clarification_turns_from_dialog(dialog) @@ -1253,4 +1253,4 @@ def dff_command_selector_skill_formatter(dialog: Dict) -> List[Dict]: def hypotheses_and_attributes(dialog: Dict) -> List[Dict]: hypotheses = dialog["human_utterances"][-1]["hypotheses"] human_uttr_attributes = [dialog["human_utterances"][-1]["annotations"] for _ in hypotheses] - return [{"hypotheses": hypotheses, "human_uttr_attributes": human_uttr_attributes}] \ No newline at end of file + return [{"hypotheses": hypotheses, "human_uttr_attributes": human_uttr_attributes}] From 4b02fe1255a5e9d074d46cb1170fca7cd2626b55 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 17:34:13 +0300 Subject: [PATCH 24/35] fix typo --- components/dvpefjoPOHC90efoi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dvpefjoPOHC90efoi.yml b/components/dvpefjoPOHC90efoi.yml index 97be9652a7..3678c3078a 100644 --- a/components/dvpefjoPOHC90efoi.yml +++ b/components/dvpefjoPOHC90efoi.yml @@ -1,5 +1,5 @@ name: response_selector -display_name: Response Selector (Fact-Checking enables) +display_name: Response Selector (Fact-Checking enabled) component_type: null model_type: Dictionary/Pattern-based is_customizable: false From 64e91196f2024006cfea59cea36f83c89e0061d1 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 17:36:14 +0300 Subject: [PATCH 25/35] revert accidental change in ranking_based_response_selector/test.py --- .../ranking_based_response_selector/test.py | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/response_selectors/ranking_based_response_selector/test.py b/response_selectors/ranking_based_response_selector/test.py index 831abe74aa..88d88655bf 100644 --- a/response_selectors/ranking_based_response_selector/test.py +++ b/response_selectors/ranking_based_response_selector/test.py @@ -1,4 +1,19 @@ -hyps_and_ies = [[1, 1], [2, 3]] +import requests +import json +from os import getenv -for hyp, ie in hyps_and_ies: - print(f"{hyp} {ie} \n\n") + +SERVICE_PORT = getenv("SERVICE_PORT") + + +def main(): + with open("test_data.json", "r") as f: + data = json.load(f) + # To skip "Oh, and remember this dialog's id" that raises error due to absence of 'dialog_id' field in test_data. + data["dialogs"][0]["human_utterances"].append(data["dialogs"][0]["human_utterances"][0]) + result = requests.post(f"http://0.0.0.0:{SERVICE_PORT}/respond", json=data).json() + assert result[0][0] in ["program_y", "movie_tfidf_retrieval"], print(result) + + +if __name__ == "__main__": + main() From ecf897c6f10f74a56685765b21d4135e54b9f7ff Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 17:37:01 +0300 Subject: [PATCH 26/35] remove debugging in dp_formatters --- state_formatters/dp_formatters.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/state_formatters/dp_formatters.py b/state_formatters/dp_formatters.py index 4133f421c1..efb0975898 100755 --- a/state_formatters/dp_formatters.py +++ b/state_formatters/dp_formatters.py @@ -1,7 +1,6 @@ import logging from copy import deepcopy from typing import Dict, List -import json from common.utils import get_entities, get_intents @@ -558,8 +557,6 @@ def persona_bot_formatter(dialog: Dict): def cropped_dialog(dialog: Dict): - with open("test_cand_ann.json", "w", encoding="utf-8") as f: - json.dump(dialog, f, ensure_ascii=False, indent=4) dialog = utils.get_last_n_turns(dialog) dialog = utils.remove_clarification_turns_from_dialog(dialog) dialog = utils.replace_with_annotated_utterances(dialog, mode="punct_sent") From 4bab16813c5940f4199f442a0239d267c72bad59 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 15 Aug 2023 17:40:07 +0300 Subject: [PATCH 27/35] added to components.tsv --- components.tsv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components.tsv b/components.tsv index a6511e6182..353ae738ae 100644 --- a/components.tsv +++ b/components.tsv @@ -183,6 +183,6 @@ 8179 dff-robot-prompted-skill 8180 8181 -8182 +8182 fact-checking 8183 external-integration-skill 8184 external-fake-server From 04466ef635447ff73b38604b48c1f6e9910dd276 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Thu, 24 Aug 2023 23:24:11 +0300 Subject: [PATCH 28/35] ranking-based-response-selector-fact-checking correct name everywhere --- assistant_dists/dream/dev.yml | 4 ++-- assistant_dists/dream/docker-compose.override.yml | 4 ++-- assistant_dists/dream/gpu1.yml | 2 +- assistant_dists/dream/pipeline_conf.json | 2 +- .../ranking-based-response-selector-fact-checking/service.yml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/assistant_dists/dream/dev.yml b/assistant_dists/dream/dev.yml index cb162ac409..5728fb9c75 100644 --- a/assistant_dists/dream/dev.yml +++ b/assistant_dists/dream/dev.yml @@ -11,9 +11,9 @@ services: - "./annotators/SentSeg:/src" ports: - 8011:8011 - ranking-based-response-selector: + ranking-based-response-selector-fact-checking: volumes: - - "./response_selectors/ranking_based_response_selector:/src" + - "./response_selectors/ranking_based_response_selector_fact_checking:/src" - "./common:/src/common" ports: - 8002:8002 diff --git a/assistant_dists/dream/docker-compose.override.yml b/assistant_dists/dream/docker-compose.override.yml index 9ab0a70386..5a328bea14 100644 --- a/assistant_dists/dream/docker-compose.override.yml +++ b/assistant_dists/dream/docker-compose.override.yml @@ -2,7 +2,7 @@ services: agent: command: sh -c 'bin/wait && python -m deeppavlov_agent.run agent.pipeline_config=assistant_dists/dream/pipeline_conf.json' environment: - WAIT_HOSTS: "sentseg:8011, ranking-based-response-selector:8002, + WAIT_HOSTS: "sentseg:8011, ranking-based-response-selector-fact-checking:8002, dff-intent-responder-skill:8012, intent-catcher:8014, ner:8021, factoid-qa:8071, kbqa:8072, entity-linking:8075, wiki-parser:8077, text-qa:8078, combined-classification:8087, fact-retrieval:8100, entity-detection:8103, @@ -17,7 +17,7 @@ services: LANGUAGE: EN FALLBACK_FILE: fallbacks_dream_en.json - ranking-based-response-selector: + ranking-based-response-selector-fact-checking: env_file: [ .env ] build: args: diff --git a/assistant_dists/dream/gpu1.yml b/assistant_dists/dream/gpu1.yml index acef2c59f5..483d0292d5 100644 --- a/assistant_dists/dream/gpu1.yml +++ b/assistant_dists/dream/gpu1.yml @@ -31,7 +31,7 @@ services: # - ./venv/data/db_data:/root/data/db sentseg: restart: unless-stopped - ranking-based-response-selector: + ranking-based-response-selector-fact-checking: restart: unless-stopped dff-intent-responder-skill: restart: unless-stopped diff --git a/assistant_dists/dream/pipeline_conf.json b/assistant_dists/dream/pipeline_conf.json index 01ad89795f..d0f7fdf1f2 100644 --- a/assistant_dists/dream/pipeline_conf.json +++ b/assistant_dists/dream/pipeline_conf.json @@ -559,7 +559,7 @@ "connector": { "protocol": "http", "timeout": 1.0, - "url": "http://ranking-based-response-selector:8002/respond" + "url": "http://ranking-based-response-selector-fact-checking:8002/respond" }, "dialog_formatter": "state_formatters.dp_formatters:cropped_dialog", "response_formatter": "state_formatters.dp_formatters:base_response_selector_formatter_service", diff --git a/response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking/service.yml b/response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking/service.yml index d2f8c1f737..3493b4bd43 100644 --- a/response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking/service.yml +++ b/response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-fact-checking/service.yml @@ -1,4 +1,4 @@ -name: ranking-based-response-selector +name: ranking-based-response-selector-fact-checking endpoints: - respond compose: From be6113d2ad86a05e62100da1b0ec6e54792b3a57 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Thu, 24 Aug 2023 23:25:25 +0300 Subject: [PATCH 29/35] added fact-checking to runtests --- tests/runtests.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/runtests.sh b/tests/runtests.sh index 370d4b7bb4..a9c4497a82 100755 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -141,7 +141,8 @@ if [[ "$MODE" == "test_skills" || "$MODE" == "all" ]]; then kbqa text-qa wiki-parser combined-classification fact-retrieval \ dff-intent-responder-skill entity-detection sentence-ranker \ property-extraction ner prompt-selector \ - dff-dream-persona-chatgpt-prompted-skill dff-google-api-skill; do + dff-dream-persona-chatgpt-prompted-skill dff-google-api-skill \ + fact-checking; do echo "Run tests for $container" dockercompose_cmd exec -T -u $(id -u) $container ./test.sh From f1fcfe43c21eecd340a8ede0755f304428a27fb4 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Thu, 24 Aug 2023 23:30:10 +0300 Subject: [PATCH 30/35] fix ranking based response selector path --- assistant_dists/dream/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assistant_dists/dream/dev.yml b/assistant_dists/dream/dev.yml index 5728fb9c75..df6fb801fa 100644 --- a/assistant_dists/dream/dev.yml +++ b/assistant_dists/dream/dev.yml @@ -13,7 +13,7 @@ services: - 8011:8011 ranking-based-response-selector-fact-checking: volumes: - - "./response_selectors/ranking_based_response_selector_fact_checking:/src" + - "./response_selectors/ranking_based_response_selector:/src" - "./common:/src/common" ports: - 8002:8002 From 968f9790d6c7f7213d300d5c8bf984900df491cf Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 5 Sep 2023 18:56:06 +0300 Subject: [PATCH 31/35] ranking-based-response-selector-fact-checking in tests --- tests/runtests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/runtests.sh b/tests/runtests.sh index a9c4497a82..cf4f937e0d 100755 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -137,7 +137,7 @@ if [[ "$MODE" == "test_skills" || "$MODE" == "all" ]]; then echo "Passing test data to each skill selected for testing" - for container in sentseg intent-catcher ranking-based-response-selector entity-linking \ + for container in sentseg intent-catcher ranking-based-response-selector-fact-checking entity-linking \ kbqa text-qa wiki-parser combined-classification fact-retrieval \ dff-intent-responder-skill entity-detection sentence-ranker \ property-extraction ner prompt-selector \ From 88e26600329f63b97b6c8d1a671bc714b42cdc8a Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 26 Sep 2023 14:13:49 +0300 Subject: [PATCH 32/35] typo fix --- assistant_dists/dream/dev.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/assistant_dists/dream/dev.yml b/assistant_dists/dream/dev.yml index df6fb801fa..949ff69bfe 100644 --- a/assistant_dists/dream/dev.yml +++ b/assistant_dists/dream/dev.yml @@ -5,7 +5,6 @@ services: - ".:/dp-agent" ports: - 4242:4242 - sentseg: volumes: - "./annotators/SentSeg:/src" From 695dcbe3c160bee60f98bc513ba9f9e70541a64d Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Tue, 26 Sep 2023 17:32:00 +0300 Subject: [PATCH 33/35] minor fixes, mainly container name --- assistant_dists/dream/pipeline_conf.json | 2 +- components.tsv | 2 +- components/dvpefjoPOHC90efoi.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assistant_dists/dream/pipeline_conf.json b/assistant_dists/dream/pipeline_conf.json index d0f7fdf1f2..b2c7fa1a69 100644 --- a/assistant_dists/dream/pipeline_conf.json +++ b/assistant_dists/dream/pipeline_conf.json @@ -558,7 +558,7 @@ "response_selector": { "connector": { "protocol": "http", - "timeout": 1.0, + "timeout": 5.0, "url": "http://ranking-based-response-selector-fact-checking:8002/respond" }, "dialog_formatter": "state_formatters.dp_formatters:cropped_dialog", diff --git a/components.tsv b/components.tsv index 082fb2ebe5..3d94a86410 100644 --- a/components.tsv +++ b/components.tsv @@ -4,7 +4,7 @@ 3882 harvesters-maintenance-gobot-skill 4242 agent 6000 ros-flask-server -8002 ranking-based-response-selector,ranking-based-response-selector-ru +8002 ranking-based-response-selector,ranking-based-response-selector-ru,ranking-based-response-selector-fact-checking 8003 llm-based-response-selector 8004 convers-evaluator-annotator 8005 confidence-based-response-selector diff --git a/components/dvpefjoPOHC90efoi.yml b/components/dvpefjoPOHC90efoi.yml index 3678c3078a..7e3a8e35eb 100644 --- a/components/dvpefjoPOHC90efoi.yml +++ b/components/dvpefjoPOHC90efoi.yml @@ -11,8 +11,8 @@ gpu_usage: null group: response_selectors connector: protocol: http - timeout: 1.0 - url: http://ranking-based-response-selector:8002/respond + timeout: 5.0 + url: http://ranking-based-response-selector-fact-checking:8002/respond dialog_formatter: state_formatters.dp_formatters:cropped_dialog response_formatter: state_formatters.dp_formatters:base_response_selector_formatter_service previous_services: From 7a4f978908f06ce16859fd4501dd27da563829b2 Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Wed, 27 Sep 2023 18:33:17 +0300 Subject: [PATCH 34/35] add SERVICE_PORT and SERVICE_NAME everywhere --- .../fact_checking/service_configs/fact-checking/environment.yml | 1 + .../fact_checking/service_configs/fact-checking/service.yml | 1 + assistant_dists/dream/docker-compose.override.yml | 2 ++ 3 files changed, 4 insertions(+) diff --git a/annotators/fact_checking/service_configs/fact-checking/environment.yml b/annotators/fact_checking/service_configs/fact-checking/environment.yml index 008f1e7671..377d25808d 100644 --- a/annotators/fact_checking/service_configs/fact-checking/environment.yml +++ b/annotators/fact_checking/service_configs/fact-checking/environment.yml @@ -1,4 +1,5 @@ SERVICE_PORT: 8182 +SERVICE_NAME: fact_checking GENERATIVE_SERVICE_URL: http://openai-api-chatgpt:8145/respond GENERATIVE_TIMEOUT: 5 GENERATIVE_SERVICE_CONFIG: openai-chatgpt.json diff --git a/annotators/fact_checking/service_configs/fact-checking/service.yml b/annotators/fact_checking/service_configs/fact-checking/service.yml index c352429862..b47396c473 100644 --- a/annotators/fact_checking/service_configs/fact-checking/service.yml +++ b/annotators/fact_checking/service_configs/fact-checking/service.yml @@ -7,6 +7,7 @@ compose: build: args: SERVICE_PORT: 8182 + SERVICE_NAME: fact_checking GENERATIVE_SERVICE_URL: http://openai-api-chatgpt:8145/respond GENERATIVE_TIMEOUT: 5 GENERATIVE_SERVICE_CONFIG: openai-chatgpt.json diff --git a/assistant_dists/dream/docker-compose.override.yml b/assistant_dists/dream/docker-compose.override.yml index dddcefa03c..9cc31ebb56 100644 --- a/assistant_dists/dream/docker-compose.override.yml +++ b/assistant_dists/dream/docker-compose.override.yml @@ -493,6 +493,8 @@ services: env_file: [ .env, .env_secret ] build: args: + SERVICE_PORT: 8182 + SERVICE_NAME: fact_checking GENERATIVE_SERVICE_URL: http://openai-api-chatgpt:8145/respond GENERATIVE_TIMEOUT: 5 GENERATIVE_SERVICE_CONFIG: openai-chatgpt.json From 8ccd3e0d8e0d34d65e1fc98f8359ba92c2a563ac Mon Sep 17 00:00:00 2001 From: Nika Smilga Date: Wed, 27 Sep 2023 19:20:58 +0300 Subject: [PATCH 35/35] small change in test for more visible effect --- annotators/fact_checking/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/annotators/fact_checking/test.py b/annotators/fact_checking/test.py index 321ff7a91b..3f89720d23 100644 --- a/annotators/fact_checking/test.py +++ b/annotators/fact_checking/test.py @@ -13,7 +13,7 @@ def main(): {"skill_name": "dff_google_api_skill", "text": "Jack is 5 years old."}, { "skill_name": "dff_dream_persona_chatgpt_prompted_skill", - "text": "Jack is 25 years old.", + "text": "Jack is 999 years old.", }, { "skill_name": "dummy_skill",