{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "VFMCdVJIIraw" }, "source": [ "##### Copyright 2019 The TensorFlow Hub Authors.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\");" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "cellView": "code", "execution": { "iopub.execute_input": "2023-05-12T11:14:50.413527Z", "iopub.status.busy": "2023-05-12T11:14:50.413323Z", "iopub.status.idle": "2023-05-12T11:14:50.417041Z", "shell.execute_reply": "2023-05-12T11:14:50.416509Z" }, "id": "ZxMYj8OpIrCp" }, "outputs": [], "source": [ "# Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved.\n", "#\n", "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", "# You may obtain a copy of the License at\n", "#\n", "# http://www.apache.org/licenses/LICENSE-2.0\n", "#\n", "# Unless required by applicable law or agreed to in writing, software\n", "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", "# See the License for the specific language governing permissions and\n", "# limitations under the License.\n", "# ==============================================================================" ] }, { "cell_type": "markdown", "metadata": { "id": "0fO2R2BBKx3l" }, "source": [ "# Multilingual Universal Sentence Encoder Q&A Retrieval\n" ] }, { "cell_type": "markdown", "metadata": { "id": "MfBg1C5NB3X0" }, "source": [ "
\n",
" ![]() | \n",
" \n",
" ![]() | \n",
" \n",
" ![]() | \n",
" \n",
" ![]() | \n",
" \n",
" ![]() | \n",
"
Random Question from SQuAD:
\n", "%s
\n", "Answer:
\n", "%s
\n", " ''' % (query_text , answer_text)\n", " else:\n", " result_md = '''\n", "Question:
\n", "%s
\n", " ''' % query_text\n", "\n", " result_md += '''\n", "Retrieved sentences :\n", "
Random Question from SQuAD:
\n", "Where was Shirey going to be when Fort Oswego was to be attacked?
\n", "Answer:
\n", "planned to attack Fort Niagara
\n", " \n", "Retrieved sentences :\n", "