diff --git a/containercontent/opt/chatbot_engine/__pycache__/manage.cpython-37.pyc b/containercontent/opt/chatbot_engine/__pycache__/manage.cpython-37.pyc new file mode 100644 index 0000000..d4e09ea Binary files /dev/null and b/containercontent/opt/chatbot_engine/__pycache__/manage.cpython-37.pyc differ diff --git a/containercontent/opt/chatbot_engine/chatbot/__pycache__/controller_ben.cpython-37.pyc b/containercontent/opt/chatbot_engine/chatbot/__pycache__/controller_ben.cpython-37.pyc new file mode 100644 index 0000000..39858fe Binary files /dev/null and b/containercontent/opt/chatbot_engine/chatbot/__pycache__/controller_ben.cpython-37.pyc differ diff --git a/containercontent/opt/chatbot_engine/chatbot/controller_ben.py b/containercontent/opt/chatbot_engine/chatbot/controller_ben.py new file mode 100644 index 0000000..bcd7d4a --- /dev/null +++ b/containercontent/opt/chatbot_engine/chatbot/controller_ben.py @@ -0,0 +1,59 @@ +from django.http import JsonResponse +from django.template import loader +import json +from prodae import knn_ben as knn_ben +from time import gmtime, strftime +from chatbot.models import Question, Responce, Question_Responce + +from importlib import import_module +from django.conf import settings +SessionStore = import_module(settings.SESSION_ENGINE).SessionStore + + +def ben(request): + if request.method == 'POST': + jsonData = json.loads(request.body.decode('utf-8')) + msg = jsonData["msg"] + userId = jsonData["userId"] + klass1 = knn_ben.klassifizieren(msg) + klass = klass1[0:2] + intent1 = klass1[0][0] + accurancy1 = klass1[0][1] + if len(klass1)>1: + intent2 = klass1[1][0] + accurancy2 = klass1[1][1] + else: + intent2 = 'Null' + accurancy2 = 'Null' + klass = str(klass) + intent1 = str(intent1) + accurancy1 = str(accurancy1) + intent2 = str(intent2) + accurancy2 = str(accurancy2) + res = knn_ben.antwort(msg, jsonData["userId"]) + time = strftime("%Y-%m-%d %H:%M:%S", gmtime()) + #s = request.session + s = SessionStore() + s.save() + sess_id = s.session_key + print(request.session.session_key) + quest = Question(session_id=userId, question_text=msg, publi_date=time) + quest.save() + resp = Responce(session_id=userId, responce_text=res, publi_date=time) + resp.save() + qr = Question_Responce(session_id=userId, question_text=msg, intent1=intent1, accurancy1=accurancy1, intent2=intent2, accurancy2=accurancy2, responce_text=res, publi_date=time) + qr.save() + return JsonResponse({ + "desc": "Success", + "klass": klass, + "intent1": intent1, + "accurancy1": accurancy1, + "intent2": intent2, + "accurancy2": accurancy2, + "ques": msg, + "res": res, + "user": userId, + "time": time + }) + else: + return JsonResponse({"desc": "Bad request"}, status=400) \ No newline at end of file diff --git a/containercontent/opt/chatbot_engine/chatbot/migrations/0002_feedback.py b/containercontent/opt/chatbot_engine/chatbot/migrations/0002_feedback.py new file mode 100644 index 0000000..8f8b64d --- /dev/null +++ b/containercontent/opt/chatbot_engine/chatbot/migrations/0002_feedback.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.8 on 2022-02-07 15:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('chatbot', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Feedback', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('session_id', models.CharField(blank=True, max_length=200, null=True)), + ('question_text', models.CharField(max_length=200)), + ('details', models.TextField()), + ('date', models.DateField(auto_now_add=True)), + ], + ), + ] diff --git a/containercontent/opt/chatbot_engine/chatbot/migrations/0003_feedback_art.py b/containercontent/opt/chatbot_engine/chatbot/migrations/0003_feedback_art.py new file mode 100644 index 0000000..1c17f6d --- /dev/null +++ b/containercontent/opt/chatbot_engine/chatbot/migrations/0003_feedback_art.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.8 on 2022-02-07 15:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('chatbot', '0002_feedback'), + ] + + operations = [ + migrations.AddField( + model_name='feedback', + name='art', + field=models.CharField(blank=True, max_length=200, null=True), + ), + ] diff --git a/containercontent/opt/chatbot_engine/chatbot/migrations/__pycache__/0002_feedback.cpython-37.pyc b/containercontent/opt/chatbot_engine/chatbot/migrations/__pycache__/0002_feedback.cpython-37.pyc new file mode 100644 index 0000000..f8a9e90 Binary files /dev/null and b/containercontent/opt/chatbot_engine/chatbot/migrations/__pycache__/0002_feedback.cpython-37.pyc differ diff --git a/containercontent/opt/chatbot_engine/chatbot/migrations/__pycache__/0003_feedback_art.cpython-37.pyc b/containercontent/opt/chatbot_engine/chatbot/migrations/__pycache__/0003_feedback_art.cpython-37.pyc new file mode 100644 index 0000000..3050393 Binary files /dev/null and b/containercontent/opt/chatbot_engine/chatbot/migrations/__pycache__/0003_feedback_art.cpython-37.pyc differ diff --git a/containercontent/opt/chatbot_engine/prodae/__pycache__/knn_ben.cpython-37.pyc b/containercontent/opt/chatbot_engine/prodae/__pycache__/knn_ben.cpython-37.pyc new file mode 100644 index 0000000..26da153 Binary files /dev/null and b/containercontent/opt/chatbot_engine/prodae/__pycache__/knn_ben.cpython-37.pyc differ diff --git a/containercontent/opt/chatbot_engine/prodae/knn_ben.py b/containercontent/opt/chatbot_engine/prodae/knn_ben.py new file mode 100644 index 0000000..fde6d1d --- /dev/null +++ b/containercontent/opt/chatbot_engine/prodae/knn_ben.py @@ -0,0 +1,2548 @@ +import nltk +from nltk.stem.snowball import GermanStemmer + +# import timeit +stemmer = GermanStemmer() +from nltk.corpus import stopwords + +import numpy as np +import random +import os +import inspect +import tensorflow as tf +import tflearn + +import re +import string + +import fnmatch +import os +import re +import requests +from bs4 import BeautifulSoup + +tf.compat.v1.reset_default_graph() + +##print('Ich bin in knn_ae!!!!!!!') + +import pickle +import json + +import fnmatch +import os +import inspect + + +def getJsonPath(): + path1 = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + path = os.path.join(path1, 'models/chat.json').replace("\\", "/") + return path + + +def getJsonPathEnt(): + path1 = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + path = os.path.join(path1, 'models/chat.json').replace("\\", "/") + return path + + +#########lade json################## +with open(getJsonPath(), encoding='UTF-8') as json_data: + dialogflow = json.load(json_data) + # ##print(dialogflow) + +##########Schreibfehler Korrektur +from spellchecker import SpellChecker + +spell = SpellChecker(language='de') + +spell.word_frequency.load_words \ + (["feedback_positiv", '!', '2', 'ab', 'abend', 'abgeben', 'abkürzung', 'adresse', 'adresse_infoorte', 'aktiv', 'alles', 'alt', 'amt', 'an', 'and', 'anmelden', 'ansprechen', 'ansprechpartner', 'antworten', 'are', 'arsch', 'arschgesicht', 'arschloch', 'auf', 'ausfüllen', 'bald', 'beantragen', 'bearbeitungsdauer', 'bedeutet', 'behörde', 'bei', 'bekacktes', 'bekomme', 'bescheid', 'bestellen', 'bezahlen', 'bis', 'bitch', 'blödian', 'brauche', 'brauchen', 'braucht', 'bye', 'ciao', 'dafür', 'dahin', 'dank', 'danke', 'darf', 'das', 'datum', 'dauert', 'dein', 'deine', 'dich', 'dir', 'du', 'e-mail', 'einreichen', 'einsehen', 'email', 'erfüllen', 'erreichbar', 'erreichbarkeit', 'erreichen', 'erzähl', 'erzähle', 'euro', 'existiert', 'fahrerlaubnis', 'fertig', 'fick', 'finde', 'flachzange', 'formulare', 'fotze', 'fragen', 'fresse', 'frida', 'frist', 'fristen', 'fuck', 'führerschein', 'führerscheinantrag', 'führerscheinklasse', 'für', 'geben', 'geboren', 'geburtstag', 'gebühr', 'gehen', 'geholfen', 'geht', 'gehts', 'gelten', 'genehmigung', 'geprüft', 'gesetz', 'gesetzliche', 'gesichtselfmeter', 'geöffnet', 'gibst', 'gibt', 'gott', 'grund', 'grüss', 'grüß', 'gut', 'guten', 'götter', 'göttinnen', 'hallo', 'halt', 'hast', 'hat', 'heißt', 'hello', 'heute', 'hey', 'hi', 'hilfe', 'hilfreich', 'hinblättern', 'hingehen', 'hoch', 'how', 'hurensohn', 'hürden', 'iban', 'ich', 'idiot', 'ihnen', 'ihre', 'in', 'info', 'informationen', 'infos', 'innerhalb', 'internet', 'irgendwas', 'ist', 'jemand', 'jemanden', 'joke', 'kackwurst', 'kann', 'kannst', 'kennst', 'klar', 'kommen', 'kopie', 'kosten', 'kostenlos', 'kostet', 'kriege', 'lang', 'lange', 'leben', 'locker', 'loser', 'lustiges', 'läuft', 'machst', 'macht', 'mal', 'maul', 'mehr', 'melden', 'mitbringen', 'morgen', 'muss', 'münzt', 'müssen', 'nach', 'nachweis', 'name', 'nicht', 'off', 'offen', 'online', 'onlineformular', 'opfer', 'original', 'papiere', 'paragraphen', 'passiert', 'penner', 'personalausweis', 'persönlich', 'privatklage', 'rathaus', 'rauszufinden', 'rechtlich', 'rechtsgrundlage', 'reicht', 'reisepass', 'rund', 'sagt', 'sbw_preamble', 'schauen', 'scheiße', 'schnell', 'schon', 'seelenloser', 'seelsorge', 'seit', 'selbstmord', 'servus', 'sex', 'sichtbar', 'sie', 'spreche', 'sprechen', 'spricht', 'spät', 'steht', 'stelle', 'stellt', 'sterben', 'suizid', 'tag', 'telefon', 'telefonnumer', 'telefonseelsorge', 'teuer', 'toll', 'tschüss', 'tun', 'uhr', 'uhrzeit', 'uhrzeiten', 'umbringen', 'ummelden', 'unterlagen', 'verabschiede', 'verfahren', 'verfahrensablauf', 'verordnung', 'viele', 'vielen', 'vollidiot', 'voraussetzungen', 'vorbeikommen', 'vorzeigen', 'wann', 'warten', 'warum', 'was', 'weit', 'weißt', 'welche', 'welches', 'wellche', 'wem', 'wen', 'wenden', 'wer', 'wichser', 'wie', 'wiedersehen', 'wieviel', 'wissen', 'witz', 'witze', 'wo', 'wochen', 'wofür', 'woher', 'you', 'zeig', 'zeit', 'zimmer', 'zu', 'zuständig', 'zuständige', 'öffnet', 'öffnungszeiten', '17', '18', 'a', 'ab', 'abgenommen', 'abhanden', 'alten', 'and', 'anhängerführerschein', 'auffindbar', 'ausland', 'ausländischer', 'b96', 'be', 'beantragen', 'befristet', 'befristeter', 'beförderung', 'begleitetes', 'begleitung', 'bekommen', 'bf', 'bf17', 'bus', 'c', 'ce', 'deutscher', 'einkassiert', 'entziehung', 'entzogen', 'entzug', 'erlaubnis', 'ersatz', 'ersatzführerschein', 'ersterteilung', 'erweitern', 'erweiterung', 'eu', 'eu-führerschein', 'fahren', 'fahrerlaubnis', 'fahrerlaubnisentzug', 'fahrgastbeförderung', 'finde', 'führerschein', 'führerscheinentzug', 'führerscheinerweiterung', 'führerscheinklasse', 'führerscheintausch', 'führerscheinumtausch', 'führerscheinverlust', 'führerscheinverlängerung', 'gefunden', 'gekommen', 'geändert', 'heirat', 'international', 'internationaler', 'jahren', 'jugendliche', 'karte', 'kartenführerschein', 'klasse', 'lappen', 'mehr', 'minderjährig', 'nachname', 'name', 'namen', 'namensänderung', 'neuer', 'neuerteilung', 'nicht', 'personen', 'personenbeförderung', 'pflichtumtausch', 'scheidung', 'tauschen', 'taxi', 'taxischein', 'umtausch', 'umtauschen', 'verloren', 'verlust', 'verlängern', 'verlängerung', 'wechseln', 'weit', 'wiedererteilung', 'ändern', 'änderung', 'öpnv', 'ab', 'abgelaufen', 'abhanden', 'ablauf', 'ablaufen', 'abzumelden', 'adresse', 'adressen', 'afrika', 'amerika', 'and', 'anschrift', 'anschriftes', 'anschrifts', 'ansprechpartner', 'anzumelden', 'argentinien', 'asien', 'auflösen', 'ausgelaufen', 'aushändigung', 'auskunft', 'ausrauben', 'australien', 'außerhalb', 'bearbeitung', 'bearbeitungsdauer', 'bedingung', 'bedingungen', 'beendet', 'belgien', 'bescheid', 'bezahlen', 'brasilien', 'bulgarien', 'bürgerbüro', 'china', 'dauer', 'dauern', 'dauert', 'deutschland', 'doppelname', 'drillinge', 'dänemark', 'ehe', 'ehename', 'ehenamen', 'einsegnen', 'ersetzen', 'erstmalig', 'estland', 'eu', 'europa', 'europäische', 'fahrausweis', 'fahrberechtigung', 'fahrerlaubnis', 'fahrerlaubnisbehörde', 'familienname', 'fingerabdruck', 'finnland', 'format', 'frankreich', 'frist', 'fristen', 'futschikato', 'führerschein', 'führerscheinbehörde', 'führerscheinstelle', 'führerschien', 'geburtsname', 'gebühr', 'gebühren', 'geheiratet', 'geklaut', 'geschieden', 'gesetz', 'gesetze', 'gesetzliche', 'gestohlen', 'getraut', 'getrennt', 'gewechselt', 'geändert', 'griechenland', 'grund', 'heirat', 'heiraten', 'hinblätern', 'hochzeit', 'hürden', 'indonesien', 'irland', 'italien', 'japan', 'jugendlich', 'kanada', 'kaputt', 'kind', 'kinder', 'kleinkind', 'kopie', 'kosten', 'kostenlos', 'kostet', 'kroatien', 'kuba', 'land', 'lange', 'lebensgemeinschaft', 'lebenspartnerschaft', 'lettland', 'liegen', 'litauen', 'luxemburg', 'läuft', 'malta', 'marokko', 'mexiko', 'motorradführerschein', 'mädchenname', 'münzt', 'nachame', 'nachname', 'nachnamen', 'nachnamens', 'nachweis', 'name', 'namen', 'namenswechsel', 'namensänderung', 'neuseeland', 'nicht', 'nichtgültig', 'nichtmehrgültig', 'nichtmehrverheiratet', 'nichtmehrzusammen', 'nichtverheiratet', 'nichtzusammen', 'niederlande', 'nordamerika', 'original', 'paragraph', 'paragraphen', 'polen', 'portugal', 'rechtlich', 'rechtsgrundlage', 'rechtsgrundlagev', 'rumänien', 'russland', 'scheiden', 'scheidung', 'schweden', 'schwinden', 'slowakei', 'slowenien', 'sohn', 'spanien', 'staaten', 'stehlen', 'stelle', 'südafrika', 'südamerika', 'teuer', 'thailand', 'tochter', 'trauen', 'trauung', 'trennen', 'tschechien', 'tunesien', 'turkei', 'ukraine', 'umzumelden', 'unauffindbar', 'ungarn', 'ungütlig', 'union', 'unterlagen', 'usa', 'veraltet', 'verehelichen', 'vereinigte', 'verfahren', 'verfahrens', 'verfahrensablauf', 'verfallen', 'verjährt', 'verlaufen', 'verlegt', 'verlieren', 'verloben', 'verlobt', 'verloren', 'verlust', 'verlängern', 'verläuft', 'vermisst', 'vermählen', 'verordnung', 'verordnungen', 'verschollen', 'verstorben', 'versunken', 'vietnam', 'voraussetzung', 'voraussetzungen', 'vorschrift', 'vorschriften', 'warten', 'wechseln', 'wegkommen', 'weit', 'wenden', 'wiederholt', 'wohnungsadresse', 'zahlen', 'zuständig', 'zuständige', 'zuständigkeit', 'zwillinge', 'zypern', 'ägypten', 'ändern', 'änderung', 'österreich', 'ablauf', 'and', 'anrufen', 'ansprechpartner', 'ausfüllen', 'aushändigung', 'auskunft', 'bearbeitung', 'bearbeitungsdauer', 'bedingung', 'bedingungen', 'behörde', 'belegen', 'bescheid', 'bezahlen', 'dauer', 'dauern', 'dauert', 'einsehen', 'erfüllen', 'erfüllt', 'fingerabdruck', 'format', 'formulare', 'frist', 'fristen', 'funktion', 'funktionen', 'gebühr', 'gebühren', 'gesetz', 'gesetze', 'gesetzliche', 'grund', 'hinblätern', 'hürden', 'kollege', 'kopie', 'kosten', 'kostenlos', 'kostet', 'kriterien', 'mitbringen', 'münzt', 'nachweis', 'nicht', 'online', 'original', 'paragraph', 'paragraphen', 'persönlich', 'rechtlich', 'rechtsgrundlage', 'rechtsgrundlagev', 'spätestens', 'teuer', 'unterlagen', 'verfahren', 'verfahrens', 'verfahrensablauf', 'verlaufen', 'verläuft', 'verordnung', 'verordnungen', 'voraussetzung', 'voraussetzungen', 'vorschrift', 'vorschriften', 'vorzeigen', 'weit', 'wenden', 'zahlen', 'zeit', 'zeitpunkt', 'zuständig', 'zuständigkeit', 'sbw_oeffnungszeiten_6008813', 'sbw_oeffnungszeiten_348', 'sbw_oeffnungszeiten_6004851', 'sbw_oeffnungszeiten_914', 'sbw_oeffnungszeiten_6004853', 'sbw_oeffnungszeiten_6004855', 'sbw_oeffnungszeiten_6004849', 'sbw_oeffnungszeiten_6004859', 'sbw_oeffnungszeiten_291', 'sbw_oeffnungszeiten_544', 'sbw_oeffnungszeiten_6004857', 'sbw_bearbeitungsdauer_6008813', 'sbw_vertiefendeinformationen_6008813', 'sbw_kosten_6008813', 'sbw_bezugsort_6008813', 'sbw_fristen_6008813', 'sbw_voraussetzungen_6008813', 'sbw_kosten_348', 'sbw_bearbeitungsdauer_348', 'sbw_vertiefendeinformationen_348', 'sbw_sonstiges_348', 'sbw_rechtsgrundlage_348', 'sbw_freigabevermerk_348', 'sbw_formulare_348', 'sbw_prozesse_348', 'sbw_organisationseinheiten_348', 'sbw_verfahrensablauf_6004851', 'sbw_fristen_6004851', 'sbw_unterlagen_6004851', 'sbw_kosten_6004851', 'sbw_bearbeitungsdauer_6004851', 'sbw_vertiefendeinformationen_6004851', 'sbw_sonstiges_6004851', 'sbw_rechtsgrundlage_6004851', 'sbw_freigabevermerk_6004851', 'sbw_zustaendigkeit_6008813', 'sbw_unterlagen_6008813', 'sbw_sonstiges_6008813', 'sbw_voraussetzungen_348', 'sbw_zustaendigkeit_348', 'sbw_bezugsort_348', 'sbw_verfahrensablauf_348', 'sbw_fristen_348', 'sbw_unterlagen_348', 'sbw_preamble_6004851', 'sbw_voraussetzungen_6004851', 'sbw_zustaendigkeit_6004851', 'sbw_bezugsort_6004851', 'sbw_rechtsgrundlage_6008813', 'sbw_freigabevermerk_6008813', 'sbw_preamble_348', 'sbw_organisationseinheiten_6004851', 'sbw_preamble_914', 'sbw_voraussetzungen_914', 'sbw_zustaendigkeit_914', 'sbw_bezugsort_914', 'sbw_fristen_914', 'sbw_verfahrensablauf_914', 'sbw_unterlagen_914', 'sbw_kosten_914', 'sbw_bearbeitungsdauer_914', 'sbw_vertiefendeinformationen_914', 'sbw_sonstiges_914', 'sbw_rechtsgrundlage_914', 'sbw_freigabevermerk_914', 'sbw_formulare_914', 'sbw_prozesse_914', 'sbw_organisationseinheiten_914', 'sbw_formulare_6004851', 'sbw_prozesse_6004851', 'sbw_preamble_6008813', 'sbw_verfahrensablauf_6008813', 'sbw_preamble_6004857', 'sbw_voraussetzungen_6004857', 'sbw_zustaendigkeit_6004857', 'sbw_bezugsort_6004857', 'sbw_verfahrensablauf_6004857', 'sbw_fristen_6004857', 'sbw_unterlagen_6004857', 'sbw_kosten_6004857', 'sbw_bearbeitungsdauer_6004857', 'sbw_vertiefendeinformationen_6004857', 'sbw_sonstiges_6004857', 'sbw_preamble_6004859', 'sbw_voraussetzungen_6004859', 'sbw_zustaendigkeit_6004859', 'sbw_bezugsort_6004859', 'sbw_verfahrensablauf_6004859', 'sbw_fristen_6004859', 'sbw_unterlagen_6004859', 'sbw_kosten_6004859', 'sbw_bearbeitungsdauer_6004859', 'sbw_vertiefendeinformationen_6004859', 'sbw_sonstiges_6004859', 'sbw_rechtsgrundlage_6004859', 'sbw_freigabevermerk_6004859', 'sbw_formulare_6004859', 'sbw_prozesse_6004859', 'sbw_organisationseinheiten_6004859', 'sbw_preamble_291', 'sbw_voraussetzungen_291', 'sbw_zustaendigkeit_291', 'sbw_bezugsort_291', 'sbw_verfahrensablauf_291', 'sbw_fristen_291', 'sbw_unterlagen_291', 'sbw_kosten_291', 'sbw_bearbeitungsdauer_291', 'sbw_vertiefendeinformationen_291', 'sbw_sonstiges_291', 'sbw_rechtsgrundlage_291', 'sbw_freigabevermerk_291', 'sbw_formulare_291', 'sbw_prozesse_291', 'sbw_organisationseinheiten_291', 'sbw_freigabevermerk_6004857', 'sbw_rechtsgrundlage_6004857', 'sbw_formulare_6004857', 'sbw_prozesse_6004857', 'sbw_organisationseinheiten_6004857', 'sbw_preamble_544', 'sbw_voraussetzungen_544', 'sbw_zustaendigkeit_544', 'sbw_bezugsort_544', 'sbw_verfahrensablauf_544', 'sbw_fristen_544', 'sbw_unterlagen_544', 'sbw_kosten_544', 'sbw_bearbeitungsdauer_544', 'sbw_vertiefendeinformationen_544', 'sbw_sonstiges_544', 'sbw_rechtsgrundlage_544', 'sbw_freigabevermerk_544', 'sbw_formulare_544', 'sbw_prozesse_544', 'sbw_organisationseinheiten_544', 'sbw_preamble_6004853', 'sbw_voraussetzungen_6004853', 'sbw_zustaendigkeit_6004853', 'sbw_bezugsort_6004853', 'sbw_verfahrensablauf_6004853', 'sbw_fristen_6004853', 'sbw_unterlagen_6004853', 'sbw_kosten_6004853', 'sbw_bearbeitungsdauer_6004853', 'sbw_vertiefendeinformationen_6004853', 'sbw_sonstiges_6004853', 'sbw_rechtsgrundlage_6004853', 'sbw_freigabevermerk_6004853', 'sbw_formulare_6004853', 'sbw_prozesse_6004853', 'sbw_organisationseinheiten_6004853', 'sbw_preamble_6004855', 'sbw_voraussetzungen_6004855', 'sbw_zustaendigkeit_6004855', 'sbw_bezugsort_6004855', 'sbw_verfahrensablauf_6004855', 'sbw_fristen_6004855', 'sbw_unterlagen_6004855', 'sbw_kosten_6004855', 'sbw_bearbeitungsdauer_6004855', 'sbw_vertiefendeinformationen_6004855', 'sbw_sonstiges_6004855', 'sbw_rechtsgrundlage_6004855', 'sbw_freigabevermerk_6004855', 'sbw_preamble_6004849', 'sbw_voraussetzungen_6004849', 'sbw_zustaendigkeit_6004849', 'sbw_bezugsort_6004849', 'sbw_verfahrensablauf_6004849', 'sbw_fristen_6004849', 'sbw_unterlagen_6004849', 'sbw_kosten_6004849', 'sbw_bearbeitungsdauer_6004849', 'sbw_vertiefendeinformationen_6004849', 'sbw_sonstiges_6004849', 'sbw_rechtsgrundlage_6004849', 'sbw_freigabevermerk_6004849', 'sbw_formulare_6004849', 'sbw_prozesse_6004849', 'sbw_organisationseinheiten_6004849' +]) +################################################### +import numpy as np + +import random +import os +import inspect + + +def getPath(file): + path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + path = os.path.join(path, file).replace("\\", "/") + return path + + +from nltk.tokenize import sent_tokenize + +#from summarize import summarize +# Veranstaltungskalender +############################################## +from datetime import timedelta +from datetime import date +from datetime import datetime + + +def next_weekday(d, weekday): + days_ahead = weekday - d.weekday() + if days_ahead <= 0: # Target day already happened this week + days_ahead += 7 + return d + timedelta(days_ahead) + + +def past_weekday(d, weekday): + days_ahead = weekday - d.weekday() + if days_ahead <= 0: # Target day already happe#######################ned this week + days_ahead -= 7 + return d + timedelta(days_ahead) + + +def sum_kata(text): + print(type(text)) + if '

Bitte beachten Sie:

' in text: + print('hierkata') + text=text.replace('

Bitte beachten Sie:

', '') + print('textkata', text) + if '

----------------------------------------------------------------------------------------------

' in text: + text=text.replace('

----------------------------------------------------------------------------------------------

', '') + article_text = BeautifulSoup(text, "html.parser") + print('article_text', article_text) + print('article_text', type(article_text)) + + paragraphs = article_text.find_all('p') + print('paragraphs', paragraphs) + print(type(paragraphs)) + anfangtext='' + + text2 = " " + + + #if len(paragraphs)>1: + if len(paragraphs) > 0: + anfangtext=paragraphs[0] + print('anfangtext', anfangtext) + paragraphs.remove(anfangtext) + anfangtext=str(anfangtext) + + print ('anfangtext', anfangtext) + print('paragraphs2', paragraphs) + + #for p in paragraphs: + #text2 = text2 + ' ' + '

' + p.text + '

' + + #text2 = re.sub(r"[-]", "", text2) + #text2 = text2.replace('Bitte beachten Sie:', '') + # print('article_text', article_text) + #print('text2', text2) + #sum = summarize(text2, sentence_count=1, language='german') + #sum = '

' + sum + '

' + #if anfangtext in sum: + #sum=sum + #print('sum', sum) + + #else: + #sum = anfangtext + sum + + anfangtext = re.sub(r"[-]", "", anfangtext) + sum = anfangtext + print('sum2', sum) + return sum + + +#################Wetter######## + +numbers = "(^a(?=\s)|eins|eine|einen|einer|einem|zwei|drei|vier|fünf|sechs|sieben|acht|neun|zehn|elf|zwölf|dreizehn|vierzehn|fünfzehn|sechszehn|siebzehn|achtzehn|neunzehn|zwanzig|dreizig|vierzig|fünfzig|sechszig|siebzig|achtzig|neunzig|hundert|tausend|1|2|3|4|5|6|7|8|9)" +day = "(montag|dienstag|mittwoch|donnerstag|freitag|samstag|sonntag)" +week_day = "(montag|dienstag|mittwoch|donnerstag|freitag|samstag|sonntag)" +month = "(januar|februar|märz|april|may|june|july|august|september|oktober|november|dezember)" +# dmy = "(wochenende|jahr|tag|woche|monat)" +dmy = "(jahr|tag|woche|monat)" +rel_day = "(heute|gestern|morgen|übermorgen)" +exp1 = "(vor|nach|in|im|später|)" +exp2 = "(diese|dieses|dieser|diesen|diesem|nächste|nächstes|nächster|nächstem|nächsten|letzte|letztes|letzter|letztem|letzten)" +# iso = "\d+[/.]\d+[/.]" +iso = "\d+[/.]\d+" +iso2 = "\d+[/.]" +year = "((?<=\s)\d{4}|^\d{4})" +# regxp1 = "((\d+|(" + numbers + "[-\s]?)+) " + dmy + "n? " + exp1 + ")" +regxp1 = "((\d+|(" + exp1 + "[-\s]?)+) " + numbers + "n? " + dmy + ")" + +regxp2 = "(" + exp2 + " (" + dmy + "|" + week_day + "|" + month + "))" +regxp8 = "(" + iso2 + " (" + month + "))" + +date1 = "([012]?[0-9]|3[01])" +regxp6 = "(" + date1 + " " + month + ")" +# regxp4 = "(" + month + " " + date + "[te]?[,]? " + year + ")" + +reg1 = re.compile(regxp1, re.IGNORECASE) +reg2 = re.compile(regxp2, re.IGNORECASE) +#####print(reg2) +reg3 = re.compile(rel_day, re.IGNORECASE) +reg4 = re.compile(iso) +reg5 = re.compile("wochenende") +reg9 = re.compile("Wochenende") +#####print(reg5) +reg6 = re.compile(regxp6, re.IGNORECASE) +reg7 = re.compile(day, re.IGNORECASE) +reg8 = re.compile(regxp8, re.IGNORECASE) +reg10 = re.compile(month, re.IGNORECASE) + + +def extractDate(text): + # Initialization + timex_found = [] + + # re.findall() finds all the substring matches, keep only the full + # matching string. Captures expressions such as 'number of days' ago, etc. + found = reg1.findall(text) + #####print('reg1') + found = [a[0] for a in found if len(a) > 1] + for timex in found: + #####print('1. reg1', timex) + timex = timex.replace('ein', '1') + timex = timex.replace('eine', '1') + timex = timex.replace('einen', '1') + timex = timex.replace('einer', '1') + timex = timex.replace('einem', '1') + timex = timex.replace('zwei', '2') + timex = timex.replace('drei', '3') + timex = timex.replace('vier', '4') + timex = timex.replace('fünf', '5') + timex = timex.replace('sechs', '6') + timex = timex.replace('sieben', '7') + timex = timex.replace('acht', '8') + timex = timex.replace('neun', '9') + timex = timex.replace('zehn', '10') + timex = timex.replace('nach', 'in') + + timex1 = (dateparser.parse('in' + timex)).strftime('%d.%m.%Y') + right_now_str = date.today().strftime('%d.%m.%Y') + z00 = right_now_str + timex_found.append(z00) + timex_found.append(timex1) + + # Variations of this thursday, next year, etc + + # Variations of month and iso + reg8.findall(text) + #####print('reg8') + found = reg8.findall(text) + found = [a[0] for a in found if len(a) > 1] + for timex in found: + #####print('reg8', timex) + timex1 = dateparser.parse(timex).strftime('%d.%m.%Y') + z00 = dateparser.parse(timex).strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(timex1) + + found = reg2.findall(text) + #####print('reg2') + found = [a[0] for a in found if len(a) > 1] + for timex in found: + #####print('reg2', timex) + if any(c in timex for c in ['nächste']): + if any(d in timex for d in ['woche', 'Woche']): + glanceweek = timedelta(days=6) + #####print(glanceweek) + right_now = date.today() + next_monday = next_weekday(right_now, 0).strftime('%d.%m.%Y') + next_monday_d = next_weekday(right_now, 0) + z01 = (next_monday_d + glanceweek) + z00 = next_monday + z01 = z01.strftime('%d.%m.%Y') + + if any(d in timex for d in ['tag', 'Tag']): + glanceweek = timedelta(days=7) + #####print(glanceweek) + right_now = date.today() + next_monday = right_now.strftime('%d.%m.%Y') + z01 = (right_now + glanceweek) + z00 = next_monday + z01 = z01.strftime('%d.%m.%Y') + + if any(d in timex for d in ['monat', 'Monat']): + timex1 = dateparser.parse('nächsten Monat').strftime('%d.%m.%Y') + day2, month2, year2 = timex1.split('.') + b = '01.' + c = '30.' + z00 = b + month2 + '.' + year2 + z01 = c + month2 + '.' + year2 + + if any(d in timex for d in ['montag', 'Montag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 0).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 0).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['dienstag', 'Dienstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 1).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 1).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['mittwoch', 'Mittwoch']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 2).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 2).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['donnerstag', 'Donnerstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 3).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 3).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['freitag', 'Freitag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 4).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 4).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['samstag', 'Samstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 5).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 5).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['sonntag', 'Sonntag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 6).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 6).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(c in timex for c in ['diese']): + if any(d in timex for d in ['woche', 'Woche']): + right_now = date.today() + next_monday = right_now.strftime('%d.%m.%Y') + next_monday_d = next_weekday(right_now, 6) + z01 = next_monday_d + z00 = next_monday + z01 = z01.strftime('%d.%m.%Y') + + if any(d in timex for d in ['monat', 'Monat']): + timex1 = dateparser.parse('diesen Monat').strftime('%d.%m.%Y') + day2, month2, year2 = timex1.split('.') + b = '01.' + c = '30.' + z00 = dateparser.parse('diesen Monat').strftime('%d.%m.%Y') + z01 = c + month2 + '.' + year2 + + if any(d in timex for d in ['montag', 'Montag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 0).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 0).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['dienstag', 'Dienstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 1).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 1).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['mittwoch', 'Mittwoch']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 2).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 2).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['donnerstag', 'Donnerstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 3).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 3).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['freitag', 'Freitag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 4).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 4).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['samstag', 'Samstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 5).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 5).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['sonntag', 'Sonntag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 6).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 6).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(c in timex for c in ['letzte']): + if any(d in timex for d in ['woche', 'Woche']): + glanceweek = timedelta(days=6) + #####print(glanceweek) + right_now = date.today() + past_monday = past_weekday(right_now, 0).strftime('%d.%m.%Y') + past_monday_d = past_weekday(right_now, 0) + z01 = (past_monday_d + glanceweek) + z00 = past_monday + z01 = z01.strftime('%d.%m.%Y') + if 'z00' in locals(): + timex_found.append(z00) + else: + timex_found.append(dateparser.parse('heute').strftime('%d.%m.%Y')) + if 'z01' in locals(): + timex_found.append(z01) + else: + timex_found.append(dateparser.parse('heute').strftime('%d.%m.%Y')) + + found = reg5.findall(text) + #####print('reg5') + # found = [a[0] for a in found if len(a) > 1] + for timex in found: + #####print('reg5', timex) + if not timex_found == []: + timex_found.clear() + + weekno = date.today().weekday() + + if weekno < 5: + #####print("Weekday") + right_now = date.today() + next_samstag = next_weekday(right_now, 5) + next_sontag = next_weekday(right_now, 6) + z00 = next_samstag.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + elif weekno == 5: + #####print("Weekday") + right_now = date.today() + next_sontag = next_weekday(right_now, 6) + z00 = right_now.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + else: + #####print("Weekday") + right_now = date.today() + z00 = right_now.strftime('%d.%m.%Y') + z01 = right_now.strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(z01) + if timex_found == []: + + weekno = date.today().weekday() + + if weekno < 5: + #####print("Weekday") + right_now = date.today() + next_samstag = next_weekday(right_now, 5) + next_sontag = next_weekday(right_now, 6) + z00 = next_samstag.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + elif weekno == 5: + #####print("Weekday") + right_now = date.today() + next_sontag = next_weekday(right_now, 6) + z00 = right_now.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + else: + #####print("Weekday") + right_now = date.today() + z00 = right_now.strftime('%d.%m.%Y') + z01 = right_now.strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(z01) + + found = reg9.findall(text) + #####print('reg9') + # found = [a[0] for a in found if len(a) > 1] + for timex in found: + #####print('reg9', timex) + if not timex_found == []: + timex_found.clear() + + weekno = date.today().weekday() + + if weekno < 5: + #####print("Weekday") + right_now = date.today() + next_samstag = next_weekday(right_now, 5) + next_sontag = next_weekday(right_now, 6) + z00 = next_samstag.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + elif weekno == 5: + #####print("Weekday") + right_now = date.today() + next_sontag = next_weekday(right_now, 6) + z00 = right_now.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + else: + #####print("Weekday") + right_now = date.today() + z00 = right_now.strftime('%d.%m.%Y') + z01 = right_now.strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(z01) + + if timex_found == []: + + weekno = date.today().weekday() + + if weekno < 5: + #####print("Weekday") + right_now = date.today() + next_samstag = next_weekday(right_now, 5) + next_sontag = next_weekday(right_now, 6) + z00 = next_samstag.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + elif weekno == 5: + #####print("Weekday") + right_now = date.today() + next_sontag = next_weekday(right_now, 6) + z00 = right_now.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + else: + #####print("Weekday") + right_now = date.today() + z00 = right_now.strftime('%d.%m.%Y') + z01 = right_now.strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(z01) + + # today, tomorrow, etc + found = reg3.findall(text) + #####print('reg3') + for timex in found: + #####print('reg3', timex) + if any(d in timex for d in ['übermorgen']): + #####print('timex', timex) + z00 = dateparser.parse('heute').strftime('%d.%m.%Y') + glanceweek = timedelta(days=2) + #####print(glanceweek) + timex1 = dateparser.parse('heute') + z01 = (timex1 + glanceweek) + z01 = z01.strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(z01) + else: + z00 = dateparser.parse(timex).strftime('%d.%m.%Y') + z01 = dateparser.parse(timex).strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(z01) + + # ISO + found = reg4.findall(text) + #####print('reg4') + for timex in found: + #####print('reg4', timex) + timex1 = dateparser.parse(timex).strftime('%d.%m.%Y') + z00 = dateparser.parse(timex).strftime('%d.%m.%Y') + #####print(z00) + timex_found.append(z00) + timex_found.append(timex1) + + # Dates + found = reg6.findall(text) + #####print('reg6') + found = [a[0] for a in found if len(a) > 1] + for timex in found: + #####print('reg6', timex) + timex1 = dateparser.parse(timex).strftime('%d.%m.%Y') + z00 = dateparser.parse(timex).strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(timex1) + + found = reg7.findall(text) + #####print('reg7') + for timex in found: + #####print('reg7', timex) + if timex_found == []: + if any(d in timex for d in ['montag', 'Montag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 0).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 0).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['dienstag', 'Dienstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 1).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 1).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['mittwoch', 'Mittwoch']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 2).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 2).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['donnerstag', 'Donnerstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 3).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 3).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['freitag', 'Freitag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 4).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 4).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['samstag', 'Samstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 5).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 5).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['sonntag', 'Sonntag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 6).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 6).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + timex_found.append(z00) + timex_found.append(z01) + + found = reg10.findall(text) + #####print('reg10') + for timex in found: + #####print('reg10', timex) + if timex_found == []: + timex1 = dateparser.parse(timex, settings={'PREFER_DAY_OF_MONTH': 'last'}).strftime('%d.%m.%Y') + z00 = dateparser.parse(timex, settings={'PREFER_DAY_OF_MONTH': 'first'}).strftime('%d.%m.%Y') + #####print(z00) + timex_found.append(z00) + timex_found.append(timex1) + + # Year + # found = reg5.findall(text) + # for timex in found: + # timex_found.append(timex) + # Tag only temporal expressions which haven't been tagged. + # for timex in timex_found: + # text = re.sub(timex + '(?!)', '' + timex + '', text) + if timex_found == []: + timex_found.append('heute') + + for match in timex_found: + if match == 'heute': + glanceweek = timedelta(days=0) + right_now = date.today() + right_now_str = date.today().strftime('%d.%m.%Y') + z01 = (right_now + glanceweek) + z00 = right_now_str + z01 = z01.strftime('%d.%m.%Y') + timex_found.remove('heute') + timex_found.append(z00) + timex_found.append(z01) + + #####print('erste element', timex_found[0]) + #####print('zwite element', timex_found[1]) + + return timex_found + + +from geotext import GeoText + + +def show_ents(doc): + print('docanfang', doc) + if "Wetter" in doc: + #print('Wetter word') + doc = doc.replace('Wetter', '') + #print('docadanach', doc) + doc = GeoText(doc) + print('doc', doc) + if doc.cities: + loc = doc.cities + #print('loc', loc) + return loc[0] + if doc.countries: + loc = doc.countries + return loc[0] + else: + return 'Freiburg' + + +def named_entity_wetter(frage): + named_entity_wetter = {} + named_entities = [] + + spacy_entity = show_ents(frage) + # print('spacy_entity', spacy_entity) + named_entities.append(spacy_entity) + named_entity_wetter['service'] = 'weather' + named_entity_wetter['location'] = list(set(named_entities)) + # print('named_entity_wetter1', named_entity_wetter) + datum = extractDate(frage) + #####print(datum) + proofDatum = datum[1] + #####print(proofDatum) + glanceweek = timedelta(days=5) + defaultproofDatum = dateparser.parse('heute') + defaultproofDatum5 = (defaultproofDatum + glanceweek) + if datetime.strptime(proofDatum, '%d.%m.%Y').date() > defaultproofDatum5.date(): + #####print('datum später!!!') + anzeige = ('Ich kann das Wetter der nächsten 5 Tage vorhersagen, danach wird die Vorhersage zu ungenau 🌈 🌦️') + named_entity_wetter['zeit'] = extractDate('nächste 4 Tage') + return anzeige, named_entity_wetter + if datetime.strptime(proofDatum, '%d.%m.%Y').date() < defaultproofDatum.date(): + #####print('datum früher!!!') + anzeige = ('Ich kann das Wetter der nächsten 5 Tage vorhersagen, danach wird die Vorhersage zu ungenau 🌈 🌦️') + named_entity_wetter['zeit'] = extractDate('nächste 4 Tage') + return anzeige, named_entity_wetter + else: + #####print('datum normal!!!') + named_entity_wetter['zeit'] = extractDate(frage) + #####print('named_entity_wetter2', named_entity_wetter) + return named_entity_wetter + + +################################################### +##########Schreibfehler Korrektur +# from spellchecker import SpellChecker + +# spell = SpellChecker(language='de') + + +################################################ + + +import pickle +import json + +# wiederherstelle alle unsere Datenstrukturen +data = pickle.load(open("prodae/models/trained_data", "rb")) +words = data['words'] +classes = data['classes'] +train_x = data['train_x'] +train_y = data['train_y'] + +# Aufbau des neuronalen Netzes +net = tflearn.input_data(shape=[None, len(train_x[0])]) +net = tflearn.fully_connected(net, 88) +net = tflearn.fully_connected(net, 88) +net = tflearn.fully_connected(net, len(train_y[0]), activation='softmax') +net = tflearn.regression(net) + +# Definiere das Modell und konfiguriere tensorboard +model = tflearn.DNN(net, tensorboard_dir='train_logs') + + +# importiere die Dialogdesign-Datei + + +def lowercase(obj): + """ Make dictionary lowercase """ + if isinstance(obj, dict): + return {k: lowercase(v) for k, v in obj.items()} + elif isinstance(obj, (list, set, tuple)): + t = type(obj) + return t(lowercase(o) for o in obj) + elif isinstance(obj, str): + if " " in obj: + object = [] + o = nltk.word_tokenize(obj) + for i in o: + i = stemmer.stem(i.lower()) + object.append(i) + s = ' ' + object = s.join(object) + return object + + else: + return stemmer.stem(obj.lower()) + else: + return obj + + +def containsAll(str, set): + """ Check whether sequence str contains ALL of the items in set. """ + return 0 not in [c in str for c in set] + + +import pickle + +with open("prodae/models/org_data", "rb") as filehandleorg: + # read the data as binary data stream + org_entiti = pickle.load(filehandleorg) + +with open("prodae/models/hilfe_data", "rb") as filehandlehilfe: + # read the data as binary data stream + hilf_entiti = pickle.load(filehandlehilfe) +with open("prodae/models/leistung_data", "rb") as filehandleleistung: + # read the data as binary data stream + leistung_entiti = pickle.load(filehandleleistung) + +with open("prodae/models/lebenslage_data", "rb") as filehandlelebenslage: + # read the data as binary data stream + lebenslage_entiti = pickle.load(filehandlelebenslage) + + +# print('stadtteile_entiti', stadtteile_entiti) + +def hilf_entity(frage): + # start = timeit.default_timer() + + # print('hier bin ich!!!') + + # d_entity = lowercase(d_entity) + ######print(hilf_entity) + ##print('hilfentity_frage!', frage) + frage = ''.join([str(elem) for elem in frage]) + ##print('hilfentity_frage1!', frage) + sentence_word = nltk.word_tokenize(frage) + ##print('sentence_word!!!', sentence_word) + # generiere die Stopwörter + stop = stopwords.words('german') + ignore_words = ['?', '!', '-', '&', '.', ',', 'auf', 'können', 'kannst', 'mehr', 'erzählen', 'erzählst', 'alten', + 'frau', + 'toll', 'beantragen', 'brauche', 'brauchen', 'beantrage', 'liebst', 'lieben', 'mein', + 'meines', 'meins', 'meiner', 'meinem', 'meines', 'meinen', 'wurde', 'möchte', 'möchten', 'möchtest','mocht', + 'wurden', 'würde', 'würden', 'funktionen', 'gern', 'gerne', 'beantragen', 'beantrage', 'beantragt', 'benötige', 'brauche'] + stop + ######Korrektur Schreibfehler + stemmed_frage = [] + named_entities = [] + for word in sentence_word: + if word == "OB": + stemmed_frage.append("oberburgermeist") + word = word.lower() + word = spell.correction(word) + lenhallo= len(frage) - len(word) + if word not in ignore_words or word == 'im' or word == 'dich' or word == 'am' or word == 'um' or word == 'was' or word == 'war' or word == 'zu' or word == 'nach' or word == 'kein' or word == 'keine' or word == 'ohne' or word == 'nicht' or word == 'dein' or word == 'wann' or word == 'dort' or word == 'dahin' or word == 'tüv' or word == 'wieder' or word == 'wie' or word == 'nicht' or word == 'viel' or word == 'wo' or word == 'wann' or word == 'warum' or word == 'wieso' or word == 'wohin' or word == 'wie' or word == 'an' or word == 'sich' or word == 'welche' or word == 'welcher' or word == 'welchen' or word == 'unter' or word == 'welches' or word == 'dir' or word == 'du' or word == 'viele' or word == 'mich' or word == 'jetzt' or word == 'mich' or word == 'bei' or word == 'darf' or word == 'kann': + word = stemmer.stem(word) + stemmed_frage.append(word) + if word == 'hallo' or word == 'hey' or word == 'hi' or word == 'servus' or word == 'mittag' or word == 'abend' or word == 'tag' or word == 'morgen' or word == 'grüß' or word == 'huhu' or word == 'moin': + if lenhallo >= 7: + print(frage, lenhallo, len(frage), len(word)) + print('ok!!!!') + stemmed_frage.remove(word) + else: + stemmed_frage.append(word) + + ####print('stemmed_frage', stemmed_frage) + named_entities = stemmed_frage + for k, v in hilf_entiti.items(): + #####print('v', v) + for item in v: + #####print('item', item) + stemmed_entity = nltk.word_tokenize(item, language='german') + #####print('stemmed_entity', stemmed_entity) + if containsAll(stemmed_frage, stemmed_entity) != 0: + print('stemmed_frage', stemmed_frage) + print('stemmed_entity', stemmed_entity) + named_entities.append(lowercase(k)) + #####print('named_entities', named_entities) + for b in stemmed_entity: + #####print('b', b) + if b in named_entities: + named_entities.remove(b) + #####print('named_entities2', named_entities) + # end = timeit.default_timer() + # time = end - start + # print('named_entities:', named_entities) + return list(set(named_entities)) + + +from fuzzywuzzy import process + + + + +def named_entity(stemmed_frage): + # start = timeit.default_timer() + + #####print(entitaet) + + # d_entity = lowercase(d_entity) + #####print(d_entity) + ######Korrektur Schreibfehler + # stemmed_frage = hilf_entity(frage) + # stemmed_frage = lowercase(stemmed_frage) + # print('stemmed_frage2', stemmed_frage) + named_entities = [] + for k, v in leistung_entiti.items(): + #####print('v', v) + for item in v: + #####print('item', item) + stemmed_entity = nltk.word_tokenize(item, language='german') + #####print('stemmed_entity2', stemmed_entity) + if containsAll(stemmed_frage, stemmed_entity) != 0: + named_entities.append(k) + named_entities = list(set(named_entities)) + #####print('named_entities', named_entities) + if len(named_entities) > 1: + for ent in named_entities: + if ent == '316': + named_entities.remove(ent) + if ent == '160': + named_entities.remove(ent) + if ent == '178': + named_entities.remove(ent) + if ent == '417': + named_entities.remove(ent) + if ent == '1439': + named_entities.remove(ent) + named_entities = named_entities[0] + # end = timeit.default_timer() + # time = end - start + # print('Zeit gebraucht:', time) + return str(named_entities).strip('[]') + +def pruef_sbw(stemmed_frage): + # start = timeit.default_timer() + + #####print(entitaet) + + # d_entity = lowercase(d_entity) + #####print(d_entity) + ######Korrektur Schreibfehler + # stemmed_frage = hilf_entity(frage) + # stemmed_frage = lowercase(stemmed_frage) + # print('stemmed_frage2', stemmed_frage) + named_entities = list(set(stemmed_frage)) + #print('named_entities pruef', named_entities) + for k, v in leistung_entiti.items(): + #print('v', v) + for item in v: + #####print('item', item) + stemmed_entity = nltk.word_tokenize(item, language='german') + #print('stemmed_entity2', stemmed_entity) + if containsAll(stemmed_frage, stemmed_entity) != 0: + for b in stemmed_entity: + #print('b', b) + if b in stemmed_frage: + if b in named_entities: + named_entities.remove(b) + named_entities.append('sbw_preamble') + named_entities = list(set(named_entities)) + #####print('named_entities', named_entities) + + # end = timeit.default_timer() + # time = end - start + # print('Zeit gebraucht:', time) + named_entities = list(set(named_entities)) + named_entities = " ".join(named_entities) + named_entities = str(named_entities) + print('pruef_sbw named_entities', named_entities) + return named_entities + +def pruef_kontext(frage): + # d_entity = lowercase(d_entity) + #####print(hilf_entity) + sentence_word = nltk.word_tokenize(frage) + #####print() + # generiere die Stopwörter + stop = stopwords.words('german') + ignore_words = ['?', '!', '.', ',', 'möchte', 'möchtest', 'möchten', 'brauche', 'brauch', 'frage', 'zu', + 'beantragen', 'beantrag', 'beantrage', 'beantragen', 'benötige', 'brauche'] + stop + ######Korrektur Schreibfehler + stemmed_frage = [] + named_entities = [] + for word in sentence_word: + + if word not in ignore_words or word == 'was' or word == 'um' or word == 'war' or word == 'zu' or word == 'nach' or word == 'kein' or word == 'keine' or word == 'ohne' or word == 'nicht' or word == 'dein' or word == 'wann' or word == 'dort' or word == 'dahin' or word == 'tüv' or word == 'wieder' or word == 'wie' or word == 'nicht' or word == 'viel' or word == 'wo' or word == 'wann' or word == 'warum' or word == 'wieso' or word == 'wohin' or word == 'wie' or word == 'an' or word == 'sich' or word == 'sich' or word == 'welche' or word == 'welcher' or word == 'welchen' or word == 'unter' or word == 'welches' or word == 'dir' or word == 'du' or word == 'viele' or word == 'mich' or word == 'jetzt' or word == 'bei' or word == 'darf' or word == 'kann': + stemmed_frage.append(word) + #####print('stemmed_frage', stemmed_frage) + named_entities = stemmed_frage + for k, v in lebenslage_entiti.items(): + #print('lebenslage_entiti.items()', lebenslage_entiti.items()) + for item in v: + #####print('item', item) + stemmed_entity = nltk.word_tokenize(item, language='german') + #####print('stemmed_entity', stemmed_entity) + if containsAll(stemmed_frage, stemmed_entity) != 0: + #print('stemmed_frage', stemmed_frage) + #print('stemmed_entity', stemmed_entity) + # named_entities.append(k) + #print('named_entities', named_entities) + for b in stemmed_entity: + print('b', b) + if b in named_entities: + named_entities.remove(b) + named_entities.append('ist') + #print('named_entities2', named_entities) + named_entities = list(set(named_entities)) + named_entities = ", ".join(named_entities) + named_entities = str(named_entities) + print(named_entities) + return named_entities + +from HanTa import HanoverTagger as ht + +def pos(frage): + named_entities = [] + tokenized_sent = nltk.word_tokenize(frage, language='german') + print(tokenized_sent) + + tagger = ht.HanoverTagger('morphmodel_ger.pgz') + + tags = tagger.tag_sent(tokenized_sent) + print(tags) + for item in tags: + if 'NN' in item: + named_entities.append('NN') + else: + named_entities.append('') + return named_entities + + +def queryfrage(frage): + # tokenisiere die synonymen + queryfrage = {} + queryfrage['prefix'] = 'Ich habe folgenden Informationen für Sie gefunden:
' + queryfrage['service'] = 'search' + queryfrage['original'] = frage + frageneu = hilf_entity(frage) + frageneu = ", ".join(frageneu) + frageneu = str(frageneu) + frageneu = frageneu.replace(',', '') + sentence_word = nltk.word_tokenize(frageneu) + #####print('sentence_word', sentence_word) + # generiere die Stopwörter + stop = stopwords.words('german') + ignore_words = ['?', '!', '-', '.', ',', 'mocht', 'frage', 'zu', 'beantragen', 'beantrag', 'gibt', 'beantrage', + 'melden', 'beantragen', 'benötige', 'brauche'] + stop + ######Korrektur Schreibfehler + sentence_words = [] + for word in sentence_word: + word = word.lower() + #####print('len frage', len(frage)) + #####print('len word', len(word)) + # word = spell.correction(word) + if word in ignore_words and (word == 'zu'): + sentence_words.append("zu") + if word not in ignore_words or word == 'was' or word == 'um' or word == 'war' or word == 'zu' or word == 'nach' or word == 'kein' or word == 'keine' or word == 'ohne' or word == 'nicht' or word == 'dein' or word == 'wann' or word == 'dort' or word == 'dahin' or word == 'tüv' or word == 'wieder' or word == 'wie' or word == 'nicht' or word == 'viel' or word == 'wo' or word == 'wann' or word == 'warum' or word == 'wieso' or word == 'wohin' or word == 'wie' or word == 'an' or word == 'sich' or word == 'welche' or word == 'welcher' or word == 'welchen' or word == 'unter' or word == 'welches' or word == 'dir' or word == 'du' or word == 'viele' or word == 'jetzt' or word == 'mich' or word == 'bei' or word == 'darf' or word == 'kann': + # if get_entity(word) is None: + sentence_words.append(word) + + + # else: + # sentence_words.append(get_entity(word)) + + # stemme jedes Wort + frage = ''.join([str(elem) for elem in frage]) + print('frage!!!!', frage) + query_word = nltk.word_tokenize(frage) + stop = stopwords.words('german') + ignore_words = ['?', '!', '-', '.', ',', 'mocht', 'frage', 'zu', 'beantragen', 'beantrag', 'gibt', 'beantrage', + 'melden', 'beantragen', 'benötige', 'brauche'] + stop + ######Korrektur Schreibfehler + query_words = [] + for word in query_word: + word = word.lower() + # ####print('len frage', len(frage)) + # ####print('len word', len(word)) + #word = spell.correction(word) + if word in ignore_words and (word == 'zu'): + query_words.append("zu") + if word not in ignore_words or word == 'was' or word == 'um' or word == 'war' or word == 'zu' or word == 'nach' or word == 'kein' or word == 'keine' or word == 'ohne' or word == 'nicht' or word == 'dein' or word == 'wann' or word == 'dort' or word == 'dahin' or word == 'tüv' or word == 'wieder' or word == 'wie' or word == 'nicht' or word == 'viel' or word == 'wo' or word == 'wann' or word == 'warum' or word == 'wieso' or word == 'wohin' or word == 'wie' or word == 'an' or word == 'sich' or word == 'welche' or word == 'welcher' or word == 'welchen' or word == 'unter' or word == 'welches' or word == 'dir' or word == 'du' or word == 'viele' or word == 'jetzt' or word == 'mich' or word == 'bei' or word == 'darf' or word == 'kann': + # if get_entity(word) is None: + query_words.append(word) + if word == 'hallo' or word == 'hey' or word == 'hi' or word == 'servus' or word == 'mittag' or word == 'abend' or word == 'tag' or word == 'morgen' or word == 'grüß' or word == 'huhu' or word == 'moin' and ( + len(frage) - len(word) >= 7): + # ####print('ok!!!!') + query_words.remove(word) + query_words = [word.lower() for word in query_words] + query_words = ", ".join(query_words) + query_words = str(query_words) + query_words = query_words.replace(',', '') + ####print('query_words',query_words) + queryfrage['query'] = query_words + return queryfrage + + +def frageBearbeitung(frage): + # tokenisiere die synonymen + frage = hilf_entity(frage) + frage = ", ".join(frage) + frage = str(frage) + frage = frage.replace(',', '') + sentence_word = nltk.word_tokenize(frage) + #####print('sentence_word', sentence_word) + # generiere die Stopwörter + stop = stopwords.words('german') + ignore_words = ['?', '!', '-', '&', '.', ',', 'auf', 'können', 'kannst', 'mehr', 'erzählen', 'erzählst', 'alten', + 'frau', + 'toll', 'haus', 'beantragen', 'brauche', 'brauchen', 'beantrage', 'liebst', 'lieben', 'mein', + 'meines', 'meins', 'meiner', 'meinem', 'meines', 'meinen', 'wurde', 'möchte', 'möchten', 'mocht', + 'wurden', 'würde', 'würden', 'funktionen', 'beantragen', 'benötige', 'brauche'] + stop + ######Korrektur Schreibfehler + sentence_words = [] + for word in sentence_word: + word = word.lower() + #####print('len frage', len(frage)) + #####print('len word', len(word)) + # word = spell.correction(word) + if word in ignore_words and (word == 'zu'): + sentence_words.append("zu") + + if word not in ignore_words or word == 'was' or word == 'war' or word == 'um' or word == 'zu' or word == 'nach' or word == 'kein' or word == 'keine' or word == 'ohne' or word == 'nicht' or word == 'dein' or word == 'wann' or word == 'dort' or word == 'dahin' or word == 'tüv' or word == 'wieder' or word == 'wie' or word == 'nicht' or word == 'viel' or word == 'wo' or word == 'wann' or word == 'warum' or word == 'wieso' or word == 'wohin' or word == 'wie' or word == 'an' or word == 'sich' or word == 'welche' or word == 'welcher' or word == 'welchen' or word == 'unter' or word == 'welches' or word == 'dir' or word == 'du' or word == 'viele' or word == 'jetzt' or word == 'mich' or word == 'bei' or word == 'darf' or word == 'kann': + # if get_entity(word) is None: + sentence_words.append(word) + + sentence_words = [word.lower() for word in sentence_words] + print('sentence_words_frage', sentence_words) + return sentence_words + + +import dateparser + +right_now = date.today() + + +def extractDateOeffnungszeit(text): + # Initialization + timex_found = [] + + # re.findall() finds all the substring matches, keep only the full + # matching string. Captures expressions such as 'number of days' ago, etc. + found = reg1.findall(text) + #####print('reg1') + found = [a[0] for a in found if len(a) > 1] + for timex in found: + #####print('1. reg1', timex) + timex = timex.replace('ein', '1') + timex = timex.replace('eine', '1') + timex = timex.replace('einen', '1') + timex = timex.replace('einer', '1') + timex = timex.replace('einem', '1') + timex = timex.replace('zwei', '2') + timex = timex.replace('drei', '3') + timex = timex.replace('vier', '4') + timex = timex.replace('fünf', '5') + timex = timex.replace('sechs', '6') + timex = timex.replace('sieben', '7') + timex = timex.replace('acht', '8') + timex = timex.replace('neun', '9') + timex = timex.replace('zehn', '10') + timex = timex.replace('nach', 'in') + + timex1 = (dateparser.parse('in' + timex)).strftime('%d.%m.%Y') + right_now_str = date.today().strftime('%d.%m.%Y') + z00 = right_now_str + timex_found.append(z00) + timex_found.append(timex1) + + # Variations of this thursday, next year, etc + + # Variations of month and iso + reg8.findall(text) + #####print('reg8') + found = reg8.findall(text) + found = [a[0] for a in found if len(a) > 1] + for timex in found: + #####print('reg8', timex) + timex1 = dateparser.parse(timex).strftime('%d.%m.%Y') + z00 = dateparser.parse(timex).strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(timex1) + + found = reg2.findall(text) + #####print('reg2') + found = [a[0] for a in found if len(a) > 1] + for timex in found: + #####print('reg2', timex) + if any(c in timex for c in ['nächste']): + if any(d in timex for d in ['woche']): + glanceweek = timedelta(days=6) + #####print(glanceweek) + right_now = date.today() + next_monday = next_weekday(right_now, 0).strftime('%d.%m.%Y') + next_monday_d = next_weekday(right_now, 0) + z01 = (next_monday_d + glanceweek) + z00 = next_monday + z01 = z01.strftime('%d.%m.%Y') + + if any(d in timex for d in ['tag']): + glanceweek = timedelta(days=7) + #####print(glanceweek) + right_now = date.today() + next_monday = right_now.strftime('%d.%m.%Y') + z01 = (right_now + glanceweek) + z00 = next_monday + z01 = z01.strftime('%d.%m.%Y') + + if any(d in timex for d in ['monat']): + timex1 = dateparser.parse('nächsten Monat').strftime('%d.%m.%Y') + day2, month2, year2 = timex1.split('.') + b = '01.' + c = '30.' + z00 = b + month2 + '.' + year2 + z01 = c + month2 + '.' + year2 + + if any(d in timex for d in ['montag', 'Montag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 0).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 0).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['dienstag', 'Dienstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 1).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 1).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['mittwoch', 'Mittwoch']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 2).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 2).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['donnerstag', 'Donnerstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 3).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 3).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['freitag', 'Freitag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 4).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 4).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['samstag', 'Samstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 5).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 5).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['sonntag', 'Sonntag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 6).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 6).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(c in timex for c in ['diese']): + if any(d in timex for d in ['woche']): + right_now = date.today() + next_monday = right_now.strftime('%d.%m.%Y') + next_monday_d = next_weekday(right_now, 6) + z01 = next_monday_d + z00 = next_monday + z01 = z01.strftime('%d.%m.%Y') + + if any(d in timex for d in ['monat']): + timex1 = dateparser.parse('diesen Monat').strftime('%d.%m.%Y') + day2, month2, year2 = timex1.split('.') + b = '01.' + c = '30.' + z00 = dateparser.parse('diesen Monat').strftime('%d.%m.%Y') + z01 = c + month2 + '.' + year2 + + if any(d in timex for d in ['montag', 'Montag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 0).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 0).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['dienstag', 'Dienstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 1).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 1).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['mittwoch', 'Mittwoch']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 2).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 2).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['donnerstag', 'Donnerstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 3).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 3).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['freitag', 'Freitag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 4).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 4).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['samstag', 'Samstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 5).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 5).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['sonntag', 'Sonntag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 6).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 6).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(c in timex for c in ['letzte']): + if any(d in timex for d in ['woche']): + glanceweek = timedelta(days=6) + #####print(glanceweek) + right_now = date.today() + past_monday = past_weekday(right_now, 0).strftime('%d.%m.%Y') + past_monday_d = past_weekday(right_now, 0) + z01 = (past_monday_d + glanceweek) + z00 = past_monday + z01 = z01.strftime('%d.%m.%Y') + if 'z00' in locals(): + timex_found.append(z00) + else: + timex_found.append(dateparser.parse('heute').strftime('%d.%m.%Y')) + if 'z01' in locals(): + timex_found.append(z01) + else: + timex_found.append(dateparser.parse('heute').strftime('%d.%m.%Y')) + + found = reg5.findall(text) + #####print('reg5') + # found = [a[0] for a in found if len(a) > 1] + for timex in found: + #####print('reg5', timex) + if not timex_found == []: + timex_found.clear() + + weekno = date.today().weekday() + + if weekno < 5: + #####print("Weekday") + right_now = date.today() + next_samstag = next_weekday(right_now, 5) + next_sontag = next_weekday(right_now, 6) + z00 = next_samstag.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + elif weekno == 5: + #####print("Weekday") + right_now = date.today() + next_sontag = next_weekday(right_now, 6) + z00 = right_now.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + else: + #####print("Weekday") + right_now = date.today() + z00 = right_now.strftime('%d.%m.%Y') + z01 = right_now.strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(z01) + if timex_found == []: + + weekno = date.today().weekday() + + if weekno < 5: + #####print("Weekday") + right_now = date.today() + next_samstag = next_weekday(right_now, 5) + next_sontag = next_weekday(right_now, 6) + z00 = next_samstag.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + elif weekno == 5: + #####print("Weekday") + right_now = date.today() + next_sontag = next_weekday(right_now, 6) + z00 = right_now.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + else: + #####print("Weekday") + right_now = date.today() + z00 = right_now.strftime('%d.%m.%Y') + z01 = right_now.strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(z01) + + found = reg9.findall(text) + #####print('reg9') + # found = [a[0] for a in found if len(a) > 1] + for timex in found: + #####print('reg9', timex) + if not timex_found == []: + timex_found.clear() + + weekno = date.today().weekday() + + if weekno < 5: + #####print("Weekday") + right_now = date.today() + next_samstag = next_weekday(right_now, 5) + next_sontag = next_weekday(right_now, 6) + z00 = next_samstag.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + elif weekno == 5: + #####print("Weekday") + right_now = date.today() + next_sontag = next_weekday(right_now, 6) + z00 = right_now.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + else: + #####print("Weekday") + right_now = date.today() + z00 = right_now.strftime('%d.%m.%Y') + z01 = right_now.strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(z01) + + if timex_found == []: + + weekno = date.today().weekday() + + if weekno < 5: + #####print("Weekday") + right_now = date.today() + next_samstag = next_weekday(right_now, 5) + next_sontag = next_weekday(right_now, 6) + z00 = next_samstag.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + elif weekno == 5: + #####print("Weekday") + right_now = date.today() + next_sontag = next_weekday(right_now, 6) + z00 = right_now.strftime('%d.%m.%Y') + z01 = next_sontag.strftime('%d.%m.%Y') + else: + #####print("Weekday") + right_now = date.today() + z00 = right_now.strftime('%d.%m.%Y') + z01 = right_now.strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(z01) + + # today, tomorrow, etc + found = reg3.findall(text) + #####print('reg3') + for timex in found: + #####print('reg3', timex) + if any(d in timex for d in ['übermorgen']): + #####print('timex', timex) + z00 = dateparser.parse('heute').strftime('%d.%m.%Y') + glanceweek = timedelta(days=2) + #####print(glanceweek) + timex1 = dateparser.parse('heute') + z01 = (timex1 + glanceweek) + z01 = z01.strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(z01) + else: + z00 = dateparser.parse(timex).strftime('%d.%m.%Y') + z01 = dateparser.parse(timex).strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(z01) + + # ISO + found = reg4.findall(text) + #####print('reg4') + for timex in found: + #####print('reg4', timex) + timex1 = dateparser.parse(timex).strftime('%d.%m.%Y') + z00 = dateparser.parse(timex).strftime('%d.%m.%Y') + #####print(z00) + timex_found.append(z00) + timex_found.append(timex1) + + # Dates + found = reg6.findall(text) + #####print('reg6') + found = [a[0] for a in found if len(a) > 1] + for timex in found: + #####print('reg6', timex) + timex1 = dateparser.parse(timex).strftime('%d.%m.%Y') + z00 = dateparser.parse(timex).strftime('%d.%m.%Y') + timex_found.append(z00) + timex_found.append(timex1) + + found = reg7.findall(text) + #####print('reg7') + for timex in found: + #####print('reg7', timex) + if timex_found == []: + if any(d in timex for d in ['montag', 'Montag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 0).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 0).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['dienstag', 'Dienstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 1).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 1).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['mittwoch', 'Mittwoch']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 2).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 2).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['donnerstag', 'Donnerstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 3).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 3).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['freitag', 'Freitag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 4).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 4).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['samstag', 'Samstag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 5).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 5).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + + if any(d in timex for d in ['sonntag', 'Sonntag']): + glanceweek = timedelta(days=7) + right_now = date.today() + next_monday = next_weekday(right_now, 6).strftime('%d.%m.%Y') + next_monday1 = next_weekday(right_now, 6).strftime('%d.%m.%Y') + z01 = next_monday1 + z00 = next_monday + timex_found.append(z00) + timex_found.append(z01) + + found = reg10.findall(text) + #####print('reg10') + for timex in found: + #####print('reg10', timex) + if timex_found == []: + timex1 = dateparser.parse(timex, settings={'PREFER_DAY_OF_MONTH': 'last'}).strftime('%d.%m.%Y') + z00 = dateparser.parse(timex, settings={'PREFER_DAY_OF_MONTH': 'first'}).strftime('%d.%m.%Y') + #####print(z00) + timex_found.append(z00) + timex_found.append(timex1) + + # Year + # found = reg5.findall(text) + # for timex in found: + # timex_found.append(timex) + # Tag only temporal expressions which haven't been tagged. + # for timex in timex_found: + # text = re.sub(timex + '(?!)', '' + timex + '', text) + + return timex_found + + +def named_entity_oefnungszeit(frage): + named_entity_oefnungszeit = {} + named_entities = [] + termin = "" + intro = "" + frage1 = str(frage) + + sentence_word = nltk.word_tokenize(frage1) + ##print('sentence_word!!!', sentence_word) + # generiere die Stopwörter + stop = stopwords.words('german') + ignore_words = ['?', '!', '.', ','] + stop + ######Korrektur Schreibfehler + stemmed_frage = [] + + for word in sentence_word: + if word == "OB": + stemmed_frage.append("oberburgermeist") + word = word.lower() + word = spell.correction(word) + if word not in ignore_words or word == 'im' or word == 'am' or word == 'um' or word == 'was' or word == 'war' or word == 'zu' or word == 'nach' or word == 'kein' or word == 'keine' or word == 'ohne' or word == 'nicht' or word == 'dein' or word == 'wann' or word == 'dort' or word == 'dahin' or word == 'tüv' or word == 'wieder' or word == 'wie' or word == 'nicht' or word == 'viel' or word == 'wo' or word == 'wann' or word == 'warum' or word == 'wieso' or word == 'wohin' or word == 'wie' or word == 'an' or word == 'sich' or word == 'welche' or word == 'welcher' or word == 'welchen' or word == 'unter' or word == 'welches' or word == 'dir' or word == 'du' or word == 'viele' or word == 'mich' or word == 'jetzt' or word == 'mich' or word == 'bei' or word == 'darf' or word == 'kann': + word = stemmer.stem(word) + stemmed_frage.append(word) + named_entities = [] + for k, v in org_entiti.items(): + #####print('v', v) + #####print('k', k) + for item in v: + #####print('item', item) + stemmed_entity = nltk.word_tokenize(item, language='german') + #####print('stemmed_entity', stemmed_entity) + if containsAll(stemmed_frage, stemmed_entity) != 0: + named_entities.append(k) + named_entity_oefnungszeit['service'] = 'oeffnungszeit' + if 'ziegelhaus' in stemmed_frage: + ####print('Lahr') + for i in named_entities: + if 'Ziegelhausen' in i: + named_entities = [] + named_entities.append(i) + ####print ('Lahr', i) + if 'schlierbach' in stemmed_frage: + ####print('offenburg') + for i in named_entities: + if 'Schlierbach' in i: + named_entities = [] + named_entities.append(i) + ####print ('offenburg', i) + if 'wiebling' in stemmed_frage: + ####print('Wolfach') + for i in named_entities: + if 'Wieblingen' in i: + named_entities = [] + named_entities.append(i) + ####print('Wolfach', i) + + if 'pfaffengrund' in stemmed_frage: + ####print('Kehl') + for i in named_entities: + if 'Pfaffengrund' in i: + named_entities = [] + named_entities.append(i) + ####print('Kehl', i) + + if 'kirchheim' in stemmed_frage: + ####print('Achern') + for i in named_entities: + if 'Kirchheim' in i: + named_entities = [] + named_entities.append(i) + ####print('Achern', i) + + if 'boxberg' in stemmed_frage: + ####print('Haslach') + for i in named_entities: + if 'Boxberg' in i: + named_entities = [] + named_entities.append(i) + ####print('Haslach', i) + if 'emmertsgrund' in stemmed_frage: + ####print('Lahr') + for i in named_entities: + if 'Emmertsgrund' in i: + named_entities = [] + named_entities.append(i) + ####print ('Lahr', i) + if 'rohrbach' in stemmed_frage: + ####print('offenburg') + for i in named_entities: + if 'Rohrbach' in i: + named_entities = [] + named_entities.append(i) + ####print ('offenburg', i) + if 'neuenheim' in stemmed_frage: + ####print('Wolfach') + for i in named_entities: + if 'Neuenheim' in i: + named_entities = [] + named_entities.append(i) + ####print('Wolfach', i) + + if 'mitt' in stemmed_frage: + ####print('Kehl') + for i in named_entities: + if 'Mitte' in i: + named_entities = [] + named_entities.append(i) + ####print('Kehl', i) + + if 'bahnstadt' in stemmed_frage: + ####print('Achern') + for i in named_entities: + if 'Bahnstadt' in i: + named_entities = [] + named_entities.append(i) + ####print('Achern', i) + + if 'bergheim' in stemmed_frage: + ####print('Haslach') + for i in named_entities: + if 'Bergheim' in i: + named_entities = [] + named_entities.append(i) + ####print('Haslach', i) + if 'sudstadt' in stemmed_frage: + ####print('Lahr') + for i in named_entities: + if 'Südstadt' in i: + named_entities = [] + named_entities.append(i) + ####print ('Lahr', i) + if 'weststadt' in stemmed_frage: + ####print('offenburg') + for i in named_entities: + if 'Weststadt' in i: + named_entities = [] + named_entities.append(i) + ####print ('offenburg', i) + if 'handschuhsheim' in stemmed_frage: + ####print('Wolfach') + for i in named_entities: + if 'Handschuhsheim' in i: + named_entities = [] + named_entities.append(i) + ####print('Wolfach', i) + + if 'altstadt' in stemmed_frage: + ####print('Kehl') + for i in named_entities: + if 'Altstadt' in i: + named_entities = [] + named_entities.append(i) + ####print('Kehl', i) + if named_entities == []: + #####print("keine Org!!!") + named_entities.append('') + named_entity_oefnungszeit[ + 'prefix'] = 'Vielleicht ist hier was Passendes dabei:

Öffnungszeiten der Stadtverwaltung

' + + named_entity_oefnungszeit['org'] = list(set(named_entities)) + #####print('named_entity_oefnungszeit1', named_entity_oefnungszeit) + + named_entity_oefnungszeit['zeit'] = extractDateOeffnungszeit(frage) + named_entity_oefnungszeit['termin'] = termin + #####print('named_entity_oefnungszeit2', named_entity_oefnungszeit) + return named_entity_oefnungszeit + + +def named_entity_infoort(frage): + named_entity_infoort = {} + named_entities = [] + termin = "" + + frage1 = str(frage) + + sentence_word = nltk.word_tokenize(frage1) + ##print('sentence_word!!!', sentence_word) + # generiere die Stopwörter + stop = stopwords.words('german') + ignore_words = ['?', '!', '.', ','] + stop + ######Korrektur Schreibfehler + stemmed_frage = [] + + for word in sentence_word: + if word == "OB": + stemmed_frage.append("oberburgermeist") + word = word.lower() + word = spell.correction(word) + if word not in ignore_words or word == 'im' or word == 'am' or word == 'um' or word == 'was' or word == 'war' or word == 'zu' or word == 'nach' or word == 'kein' or word == 'keine' or word == 'ohne' or word == 'nicht' or word == 'dein' or word == 'wann' or word == 'dort' or word == 'dahin' or word == 'tüv' or word == 'wieder' or word == 'wie' or word == 'nicht' or word == 'viel' or word == 'wo' or word == 'wann' or word == 'warum' or word == 'wieso' or word == 'wohin' or word == 'wie' or word == 'an' or word == 'sich' or word == 'welche' or word == 'welcher' or word == 'welchen' or word == 'unter' or word == 'welches' or word == 'dir' or word == 'du' or word == 'viele' or word == 'mich' or word == 'jetzt' or word == 'mich' or word == 'bei' or word == 'darf' or word == 'kann': + word = stemmer.stem(word) + stemmed_frage.append(word) + + named_entities = [] + for k, v in org_entiti.items(): + ####print('v', v) + ####print('k', k) + for item in v: + ####print('item', item) + stemmed_entity = nltk.word_tokenize(item, language='german') + ####print('stemmed_entity', stemmed_entity) + if containsAll(stemmed_frage, stemmed_entity) != 0: + named_entities.append(k) + named_entity_infoort['service'] = 'infoort' + if 'ziegelhaus' in stemmed_frage: + ####print('Lahr') + for i in named_entities: + if 'Ziegelhausen' in i: + named_entities = [] + named_entities.append(i) + ####print ('Lahr', i) + if 'schlierbach' in stemmed_frage: + ####print('offenburg') + for i in named_entities: + if 'Schlierbach' in i: + named_entities = [] + named_entities.append(i) + ####print ('offenburg', i) + if 'wiebling' in stemmed_frage: + ####print('Wolfach') + for i in named_entities: + if 'Wieblingen' in i: + named_entities = [] + named_entities.append(i) + ####print('Wolfach', i) + + if 'pfaffengrund' in stemmed_frage: + ####print('Kehl') + for i in named_entities: + if 'Pfaffengrund' in i: + named_entities = [] + named_entities.append(i) + ####print('Kehl', i) + + if 'kirchheim' in stemmed_frage: + ####print('Achern') + for i in named_entities: + if 'Kirchheim' in i: + named_entities = [] + named_entities.append(i) + ####print('Achern', i) + + if 'boxberg' in stemmed_frage: + ####print('Haslach') + for i in named_entities: + if 'Boxberg' in i: + named_entities = [] + named_entities.append(i) + ####print('Haslach', i) + if 'emmertsgrund' in stemmed_frage: + ####print('Lahr') + for i in named_entities: + if 'Emmertsgrund' in i: + named_entities = [] + named_entities.append(i) + ####print ('Lahr', i) + if 'rohrbach' in stemmed_frage: + ####print('offenburg') + for i in named_entities: + if 'Rohrbach' in i: + named_entities = [] + named_entities.append(i) + ####print ('offenburg', i) + if 'neuenheim' in stemmed_frage: + ####print('Wolfach') + for i in named_entities: + if 'Neuenheim' in i: + named_entities = [] + named_entities.append(i) + ####print('Wolfach', i) + + if 'mitt' in stemmed_frage: + ####print('Kehl') + for i in named_entities: + if 'Mitte' in i: + named_entities = [] + named_entities.append(i) + ####print('Kehl', i) + + if 'bahnstadt' in stemmed_frage: + ####print('Achern') + for i in named_entities: + if 'Bahnstadt' in i: + named_entities = [] + named_entities.append(i) + ####print('Achern', i) + + if 'bergheim' in stemmed_frage: + ####print('Haslach') + for i in named_entities: + if 'Bergheim' in i: + named_entities = [] + named_entities.append(i) + ####print('Haslach', i) + if 'sudstadt' in stemmed_frage: + ####print('Lahr') + for i in named_entities: + if 'Südstadt' in i: + named_entities = [] + named_entities.append(i) + ####print ('Lahr', i) + if 'weststadt' in stemmed_frage: + ####print('offenburg') + for i in named_entities: + if 'Weststadt' in i: + named_entities = [] + named_entities.append(i) + ####print ('offenburg', i) + if 'handschuhsheim' in stemmed_frage: + ####print('Wolfach') + for i in named_entities: + if 'Handschuhsheim' in i: + named_entities = [] + named_entities.append(i) + ####print('Wolfach', i) + + if 'altstadt' in stemmed_frage: + ####print('Kehl') + for i in named_entities: + if 'Altstadt' in i: + named_entities = [] + named_entities.append(i) + ####print('Kehl', i) + if named_entities == []: + ####print("keine Org!!!") + named_entities.append('Bürgerservice') + + print('named_entity_infoort1', named_entity_infoort) + named_entity_infoort['org'] = list(set(named_entities)) + named_entity_infoort['termin'] = termin + print('named_entity_infoort1', named_entity_infoort) + + return named_entity_infoort + + + +# Rückgabe bag of words array: 0 oder 1 für jedes Wort in der 'bag', die im Satz existiert +def bow(frage, words, show_details=False): + liste = frageBearbeitung(frage) + sentence_words = liste + bag = [0] * len(words) + for s in sentence_words: + for i, w in enumerate(words): + if w == s: + bag[i] = 1 + if show_details: + print("found in bag: %s" % w) + + return (np.array(bag)) + +# lade unsre gespeicherte Modell +model.load('prodae/models/model.tflearn') +# Aufbau unseres Antwortprozessors. +# Erstellen einer Datenstruktur, die den Benutzerkontext enthält +context = {} + +ERROR_THRESHOLD = 0.01 + + +def klassifizieren(frage): + # generiere Wahrscheinlichkeiten von dem Modell + results = model.predict([bow(frage, words)])[0] + + # herausfiltern Vorhersagen unterhalb eines Schwellenwerts + results = [[i, r] for i, r in enumerate(results) if r > ERROR_THRESHOLD] + # nach Stärke der Wahrscheinlichkeit sortieren + results.sort(key=lambda x: x[1], reverse=True) + return_list = [] + for r in results: + return_list.append((classes[r[0]], r[1])) + return return_list + + +def antwort(frage, userId, show_details=False): + print('Context#####', context) + + d_itent = [] + + for itent in dialogflow['antwort_leistungen']: + try: + d_itent.append([itent['intent']]) + except KeyError: + d_itent.append([itent['intent']]) + + d_itent = [item for sublist in d_itent for item in sublist] + + + if frage in d_itent: + #print('12') + next_intent = frage + results = [(next_intent, 1.0)] + #####print(results) + #####print(results[0][0]) + while results: + for i in dialogflow['antwort_leistungen']: + + # finde ein intent, das dem ersten Ergebnis entspricht + if i['intent'] == results[0][0]: + a = i['intent'] + + b = re.sub('sbw_.*?_', '', a, flags=re.DOTALL) + + intent_context1 = i['intent'] + context[userId] = intent_context1 + ant = i['antwort'] + print('ant1!!!', ant) + if 'sbw_preamble' in i['intent']: + text = str(i['antwort'][0]) + number_of_sentences = sent_tokenize(text) + print('len(number_of_sentences)', len(number_of_sentences)) + + if len(number_of_sentences) > 2: + sum = sum_kata(text) + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:

' + sum + '
genauere Informationen finden Sie hier!' + text + '


' + voice = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:

' + sum + '

Weitere Informationen finden Sie im Textfenster

' + else: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + \ + i['antwort'][0] + + voice = ant + '

Weitere Informationen finden Sie im Textfenster

' + ant1 = ant + ( + '

Welche zusätzlichen Informationen möchten Sie ansehen?

' % ( + b, b, b, b, b, b, b, b, b, b)) + + return [ant1, voice] + + + if not ant: + if 'sbw_kosten' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Leider kann ich Ihnen dazu keine Informationen liefern. Bitte wenden Sie sich an die zuständige Stelle

' + return ant + + if 'sbw_bearbeitungsdauer' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Leider kann ich Ihnen dazu keine Informationen liefern. Bitte wenden Sie sich an die zuständige Stelle

' + return ant + if 'sbw_fristen' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Leider kann ich Ihnen dazu keine Informationen liefern. Bitte wenden Sie sich an die zuständige Stelle

' + return ant + else: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Keine Angabe

' + return ant + if i['antwort'][0] == 'keine Angaben': + print('hier1!!!') + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Es gibt keine Online Anträge

' + return ant + if i['antwort'][0] == '

keine

': + print('hier1!!!') + if 'sbw_kosten' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Diese Leistung ist kostenfrei.

' + return ant + + if 'sbw_bearbeitungsdauer' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Die Bearbeitung erfolgt sofort.

' + return ant + + if 'sbw_fristen' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Sie müssen keine Fristen beachten.

' + return ant + + else: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

keine

' + return ant + else: + print('hier2!!!') + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + i['antwort'][0] + return ant + + #####print('1') + + results.pop(0) + + else: + #print('klassifi') + stemmed_frage = hilf_entity(frage) + if len(named_entity(stemmed_frage)) != 0: + frage=pruef_sbw(stemmed_frage) + print('fragebearb', frage) + results = klassifizieren(frage) + print('klassifiresults', results) + #print('fragebearb') + #print('stemmed_frage=hilf_entity(frage)', stemmed_frage) + #####print('13') + ###print(results) + accurancy = results[0][1] + frage_test = "bgfdtgh" + #wert_accurancy = klassifizieren(frage_test)[0][1] + wert_accurancy = 0.30 + print('wert_accurancy', wert_accurancy) + print('accurancy', accurancy) + #kontextliste = load_kontextliste(userId) + # #####print(results[0][0]) + + while results: + for i in dialogflow['dialogflow']: + # finde ein intent, das dem ersten Ergebnis entspricht + if i['intent'] == results[0][0]: + # Setze bei Bedarf Kontext für diese dialog + # Überprüfe, ob diese Inetnt kontextbezogen ist + + + if i['intent'] == 'lebenslage_fuehrerschein': + ant = i['antwort'] + voice='

Hier erfahren Sie

Wählen Sie bitte die für Sie richtige Leistung

' + return [ant, voice] + + + if i['intent'] == 'sbw_preamble': + ##print('frage', frage) + entity_sbw = named_entity(stemmed_frage) + if len(entity_sbw) > 0: + #####print('entity sbw!') + context[userId] = {} + context[userId] = 'sbw_preamble' + entity_sbw = entity_sbw.strip("''") + next_intent = context[userId] + '_' + entity_sbw + ###print('next_intent_label', next_intent) + results = [(next_intent, 1.0)] + #####print(results) + #####print(results[0][0]) + context[userId] = next_intent + #####print('context1:', context) + while results: + for i in dialogflow['antwort_leistungen']: + # finde ein intent, das dem ersten Ergebnis entspricht + if i['intent'] == results[0][0]: + a = i['intent'] + b = re.sub('sbw_.*?_', '', a, flags=re.DOTALL) + ant = i['antwort'] + text = str(i['antwort'][0]) + number_of_sentences = sent_tokenize(text) + #print('len(number_of_sentences)', len(number_of_sentences)) + + if not ant: + ant= 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:'+ '

Keine Angabe

' + + + else: + + text = str(i['antwort'][0]) + + number_of_sentences = sent_tokenize(text) + + # print('len(number_of_sentences)', len(number_of_sentences)) + + if len(number_of_sentences) > 2: + + sum = sum_kata(text) + + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:

' + sum + '
genauere Informationen finden Sie hier!' + text + '


' + + voice = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:

' + sum + '

Weitere Informationen finden Sie im Textfenster

' + + + else: + + if i['antwort'][0] == 'keine Angaben': + + print('hier1!!!') + + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Es gibt keine Online Anträge

' + + else: + + print('hier2!!!') + + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + \ + \ + i['antwort'][0] + + voice = ant + '

Weitere Informationen finden Sie im Textfenster

' + + ant1 = ant + ( + '

Welche zusätzlichen Informationen möchten Sie ansehen?

' % ( + b, b, b, b, b, b, b, b, b, b)) + + #####print('ant', ant) + #####print('ant1', ant1) + return [ant1, voice] + + results.pop(0) + else: + #####print('keine sbw_entität!!!') + + #####print('keine sbw_entität und kein kontext!!!!') + #####print('accurancy', accurancy) + #####print('wert_accurancy', wert_accurancy) + #stemmed_frage= frageBearbeitung(frage) + #####print('frage!!!', stemmed_frage) + + if 'fuhrerschein' in stemmed_frage: + # print('len(stemmed_frage)', len(stemmed_frage)) + + results = 'lebenslage_fuehrerschein' + print('resultsstemmed_frage_intent', results) + for i in dialogflow['dialogflow']: + # finde ein intent, das dem ersten Ergebnis entspricht + if i['intent'] == results: + print('stemmed_frage_intent') + ant = i['antwort'] + voice = '

Hier erfahren Sie

Wählen Sie bitte die für Sie richtige Leistung

' + + return [ant, voice] + + else: + return ('

Ich bin ein Prototyp, der Ihnen verschiedene Fragen zum Thema Führerschein beantworten kann.

Um Ihnen weiterhelfen zu können, benötige ich genauere Informationen.
Können Sie bitte Ihre Frage anders formulieren?

') + + + if 'sbw_' in i['intent']: + #print('sbw_ in i[intent]') + entity_sbw = named_entity(stemmed_frage) + if len(entity_sbw) > 0: + #####print('entity sbw!') + + context[userId] = {} + context[userId] = i['intent'] + ##print('context[userId]', context[userId]) + entity_sbw = entity_sbw.strip("''") + next_intent = context[userId] + '_' + entity_sbw + ##print('next_intent_label', next_intent) + results = [(next_intent, 1.0)] + #####print(results) + #####print(results[0][0]) + context[userId] = next_intent + #####print('context1:', context) + while results: + for i in dialogflow['antwort_leistungen']: + # finde ein intent, das dem ersten Ergebnis entspricht + if i['intent'] == results[0][0]: + ant = i['antwort'] + + + if not ant: + if 'sbw_kosten' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Leider kann ich Ihnen dazu keine Informationen liefern. Bitte wenden Sie sich an die zuständige Stelle

' + return ant + + if 'sbw_bearbeitungsdauer' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Leider kann ich Ihnen dazu keine Informationen liefern. Bitte wenden Sie sich an die zuständige Stelle

' + return ant + if 'sbw_fristen' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Leider kann ich Ihnen dazu keine Informationen liefern. Bitte wenden Sie sich an die zuständige Stelle

' + return ant + else: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Leider kann ich Ihnen dazu keine Informationen liefern. Bitte wenden Sie sich an die zuständige Stelle

' + return ant + else: + if i['antwort'][0] == 'keine Angaben': + print('hier1!!!') + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Es gibt keine Online Anträge

' + return ant + if i['antwort'][0] == '

keine

': + print('hier1!!!') + if 'sbw_kosten' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Diese Leistung ist kostenfrei.

' + return ant + + if 'sbw_bearbeitungsdauer' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Die Bearbeitung erfolgt sofort.

' + return ant + + if 'sbw_fristen' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Sie müssen keine Fristen beachten.

' + return ant + + else: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

keine

' + return ant + else: + print('hier2!!!') + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + i['antwort'][ + 0] + return ant + return ant + + results.pop(0) + if len(entity_sbw) == 0: + print('keine sbw_entitäterfedferdf!!!') + #print('userId', context[userId]) + stemmed_frage = frageBearbeitung(frage) + if userId in context and 'sbw_' in context[userId]: + print('sbw_ in context keine sbw_entitäterfedferdf!!!') + frage_neu = pruef_kontext(frage) + print('frage_neu', frage_neu) + post = pos(frage_neu) + print('ueberpruefung_kontext', pos) + + ###print('frage!', stemmed_frage) + + if 'fuhrerschein' in stemmed_frage: + # print('len(stemmed_frage)', len(stemmed_frage)) + + results = 'lebenslage_fuehrerschein' + print('resultsstemmed_frage_intent', results) + for i in dialogflow['dialogflow']: + # finde ein intent, das dem ersten Ergebnis entspricht + if i['intent'] == results: + print('stemmed_frage_intent') + ant = i['antwort'] + voice = '

Hier erfahren Sie

Wählen Sie bitte die für Sie richtige Leistung

' + + return [ant, voice] + + if 'NN' in post: + if i['intent'] == 'sbw_oeffnungszeiten': + ant = "
\n
\n
\n
Öffnungszeiten Kfz-Bürgerbüro / Führerschein
\n
\n
\n
\n
\n
Allgemeine Sprechzeit
\n
\n
Montag 8 - 12 Uhr und 14 - 16 Uhr
\n
Dienstag 8 - 12 Uhr und 14 - 16 Uhr
\n
Mittwoch 8 - 12 Uhr und 14 - 16 Uhr
\n
Donnerstag 8 - 12 Uhr und 14 - 16 Uhr
\n
Freitag 8 - 12 Uhr
\n
\n
\n
\n
\n
" + + return (ant) + else: + return ('

Ich bin ein Prototyp, der Ihnen verschiedene Fragen zum Thema Führerschein beantworten kann.

Um Ihnen weiterhelfen zu können, benötige ich genauere Informationen.
Können Sie bitte Ihre Frage anders formulieren?

') + + else: + a = context[userId] + label = re.sub('sbw_.*?_', '', a, flags=re.DOTALL) + next_intent = i['intent'] + '_' + label + print('next_intent_label', next_intent) + results = [(next_intent, 1.0)] + print(results) + print(results[0][0]) + context[userId] = next_intent + print('context1:', context) + while results: + for i in dialogflow['antwort_leistungen']: + # finde ein intent, das dem ersten Ergebnis entspricht + if i['intent'] == results[0][0]: + # Setze bei Bedarf Kontext für diese dialog + ant = i['antwort'] + print('ant', ant) + + + if not ant: + if 'sbw_kosten' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Leider kann ich Ihnen dazu keine Informationen liefern. Bitte wenden Sie sich an die zuständige Stelle

' + return ant + + if 'sbw_bearbeitungsdauer' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Leider kann ich Ihnen dazu keine Informationen liefern. Bitte wenden Sie sich an die zuständige Stelle

' + return ant + if 'sbw_fristen' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Leider kann ich Ihnen dazu keine Informationen liefern. Bitte wenden Sie sich an die zuständige Stelle

' + return ant + else: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Leider kann ich Ihnen dazu keine Informationen liefern. Bitte wenden Sie sich an die zuständige Stelle

' + return ant + else: + if i['antwort'][0] == 'keine Angaben': + print('hier1!!!') + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Es gibt keine Online Anträge

' + return ant + if i['antwort'][0] == '

keine

': + print('hier1!!!') + if 'sbw_kosten' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Diese Leistung ist kostenfrei.

' + return ant + + if 'sbw_bearbeitungsdauer' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Die Bearbeitung erfolgt sofort.

' + return ant + + if 'sbw_fristen' in i['intent']: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

Sie müssen keine Fristen beachten.

' + return ant + + else: + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + '

keine

' + return ant + else: + print('hier2!!!') + ant = 'Ich habe folgende Informationen auf dem Portal service-bw für Sie gefunden:' + \ + i['antwort'][ + 0] + return ant + + return ant + + results.pop(0) + else: + #print('keine sbw_entität und kein kontext!!!!') + + + + if i['intent'] == 'sbw_organisationseinheiten' and accurancy > float(wert_accurancy): + ant = "
\n
\n
\n
\n
\n
Kfz-Bürgerbüro / Führerschein
\n
\n
Badstraße 20
\n
Offenburg
\n
Telefon: 0781 805 9495
\n
\n
\n
" + return (ant) + + if i['intent'] == 'sbw_oeffnungszeiten' and accurancy > float(wert_accurancy): + ant = "
\n
\n
\n
Öffnungszeiten Kfz-Bürgerbüro / Führerschein
\n
\n
\n
\n
\n
Allgemeine Sprechzeit
\n
\n
Montag 8 - 12 Uhr und 14 - 16 Uhr
\n
Dienstag 8 - 12 Uhr und 14 - 16 Uhr
\n
Mittwoch 8 - 12 Uhr und 14 - 16 Uhr
\n
Donnerstag 8 - 12 Uhr und 14 - 16 Uhr
\n
Freitag 8 - 12 Uhr
\n
\n
\n
\n
\n
" + + return (ant) + + if 'fuhrerschein' in stemmed_frage: + # print('len(stemmed_frage)', len(stemmed_frage)) + + results = 'lebenslage_fuehrerschein' + print('resultsstemmed_frage_intent', results) + for i in dialogflow['dialogflow']: + # finde ein intent, das dem ersten Ergebnis entspricht + if i['intent'] == results: + print('stemmed_frage_intent') + ant = i['antwort'] + voice = '

Hier erfahren Sie

Wählen Sie bitte die für Sie richtige Leistung

' + + return [ant, voice] + + + + + else: + + if 'fuhrerschein' in stemmed_frage: + # print('len(stemmed_frage)', len(stemmed_frage)) + + results = 'lebenslage_fuehrerschein' + print('resultsstemmed_frage_intent', results) + for i in dialogflow['dialogflow']: + # finde ein intent, das dem ersten Ergebnis entspricht + if i['intent'] == results: + print('stemmed_frage_intent') + ant = i['antwort'] + voice = '

Hier erfahren Sie

Wählen Sie bitte die für Sie richtige Leistung

' + + return [ant, voice] + + else: + + return ('

Ich bin ein Prototyp, der Ihnen verschiedene Fragen zum Thema Führerschein beantworten kann.

Um Ihnen weiterhelfen zu können, benötige ich genauere Informationen.
Können Sie bitte Ihre Frage anders formulieren?

') + + + + if 'kontext' in i: + #####print('11111') + if show_details: print('context1111:', i['kontext']) + context[userId] = i['kontext'] + #####print(context) + + + if i['intent'] == 'adresse_infoorte' and accurancy < float(wert_accurancy): + + if 'fuhrerschein' in stemmed_frage: + # print('len(stemmed_frage)', len(stemmed_frage)) + + results = 'lebenslage_fuehrerschein' + print('resultsstemmed_frage_intent', results) + for i in dialogflow['dialogflow']: + # finde ein intent, das dem ersten Ergebnis entspricht + if i['intent'] == results: + print('stemmed_frage_intent') + ant = i['antwort'] + voice = '

Hier erfahren Sie

Wählen Sie bitte die für Sie richtige Leistung

' + + return [ant, voice] + + else: + return ('

Ich bin ein Prototyp, der Ihnen verschiedene Fragen zum Thema Führerschein beantworten kann.

Um Ihnen weiterhelfen zu können, benötige ich genauere Informationen.
Können Sie bitte Ihre Frage anders formulieren?

') + + + + + if i['intent'] == 'smalltalk_uhrzeit': + print('Uhrzeit') + ant = datetime.now().strftime('%H:%M:%S') + return (ant) + if i['intent'] == 'smalltalk_datum': + #####print('Datum') + ant = date.today().strftime('%d.%m.%Y') + return (ant) + + + if not 'kontextpruefung' in i or \ + (userId in context and 'kontextpruefung' in i and i['kontextpruefung'] == context[userId]): + ####print('if not kontextpruefung in i or userId in context and kontextpruefung in i and i[kontextpruefung] == context[userId]') + #####print(context) + #####print(i['intent']) + + + if 'kontextneu' in i: + #####print('3') + context[userId] = i['kontextneu'] + if show_details: print('context2:', i['kontextneu']) + return random.choice(i['antwort']) + + + + if not 'kontextpruefung' in i: + + if 'smalltalk_' in i['intent'] and accurancy>float(wert_accurancy): + ####print('smalltalk!') + return random.choice(i['antwort']) + + + if accurancy > float(wert_accurancy): + #####print('accurancy', accurancy) + #####print('float(wert_accurancy)', float(wert_accurancy)) + ####print('2.1') + #####print(context) + ant = random.choice(i['antwort']) + return ant + + + if accurancy <= float(wert_accurancy): + + + #####print('2.2') + #####print(context) + return ('

Ich bin ein Prototyp, der Ihnen verschiedene Fragen zum Thema Führerschein beantworten kann.

Um Ihnen weiterhelfen zu können, benötige ich genauere Informationen.
Können Sie bitte Ihre Frage anders formulieren?

') + + + ant = random.choice(i['antwort']) + return ant + + + if not userId in context and 'kontextpruefung' in i: + ####print('if not userId in context and kontextpruefung in i') + # #####print('kontextpruefung1:', i['kontextpruefung']) + if show_details: print('intent:', i['intent']) + # generiere eine zufällige Antwort von dem dialog + if 'kontextneu' in i: + #####print('3') + context[userId] = i['kontextneu'] + if show_details: print('context2:', i['kontextneu']) + if accurancy <= float(wert_accurancy): + ####print('2.2') + #####print(context) + return ('

Ich bin ein Prototyp, der Ihnen verschiedene Fragen zum Thema Führerschein beantworten kann.

Um Ihnen weiterhelfen zu können, benötige ich genauere Informationen.
Können Sie bitte Ihre Frage anders formulieren?

') + + + if accurancy > float(wert_accurancy): + #####print('accurancy', accurancy) + #####print('float(wert_accurancy)', float(wert_accurancy)) + #####print('2.1') + #####print(context) + ant = random.choice(i['antwort']) + return ant + + + if userId in context and 'kontextpruefung' in i and i['kontextpruefung'] != context[userId]: + ####print('if userId in context and kontextpruefung in i and i[kontextpruefung] != context[userId]') + #####print('4') + # #####print('kontextpruefung1:', i['kontextpruefung']) + if show_details: print('intent:', i['intent']) + # generiere eine zufällige Antwort von dem dialog + if 'kontextneu' in i: + #####print('3') + context[userId] = i['kontextneu'] + if show_details: print('context2:', i['kontextneu']) + if accurancy <= float(wert_accurancy): + ####print('2.2') + #####print(context) + return ('

Ich bin ein Prototyp, der Ihnen verschiedene Fragen zum Thema Führerschein beantworten kann.

Um Ihnen weiterhelfen zu können, benötige ich genauere Informationen.
Können Sie bitte Ihre Frage anders formulieren?

') + + + if accurancy > float(wert_accurancy): + #####print('accurancy', accurancy) + #####print('float(wert_accurancy)', float(wert_accurancy)) + ####print('2.1') + #####print(context) + ant = random.choice(i['antwort']) + return ant + + + results.pop(0) diff --git a/containercontent/opt/chatbot_engine/prodae/models/train_logs/3BRR3F/events.out.tfevents.1644238007.F1RRZN743 b/containercontent/opt/chatbot_engine/prodae/models/train_logs/3BRR3F/events.out.tfevents.1644238007.F1RRZN743 new file mode 100644 index 0000000..2f18259 Binary files /dev/null and b/containercontent/opt/chatbot_engine/prodae/models/train_logs/3BRR3F/events.out.tfevents.1644238007.F1RRZN743 differ diff --git a/containercontent/opt/chatbot_engine/prodae/models/train_logs/408B7J/events.out.tfevents.1644245912.F1RRZN743 b/containercontent/opt/chatbot_engine/prodae/models/train_logs/408B7J/events.out.tfevents.1644245912.F1RRZN743 new file mode 100644 index 0000000..dc5144b Binary files /dev/null and b/containercontent/opt/chatbot_engine/prodae/models/train_logs/408B7J/events.out.tfevents.1644245912.F1RRZN743 differ diff --git a/containercontent/opt/chatbot_engine/prodae/models/train_logs/9GH3XN/events.out.tfevents.1644238520.F1RRZN743 b/containercontent/opt/chatbot_engine/prodae/models/train_logs/9GH3XN/events.out.tfevents.1644238520.F1RRZN743 new file mode 100644 index 0000000..4c89ca6 Binary files /dev/null and b/containercontent/opt/chatbot_engine/prodae/models/train_logs/9GH3XN/events.out.tfevents.1644238520.F1RRZN743 differ diff --git a/containercontent/opt/chatbot_engine/prodae/models/train_logs/L47OO2/events.out.tfevents.1644219964.F1RRZN743 b/containercontent/opt/chatbot_engine/prodae/models/train_logs/L47OO2/events.out.tfevents.1644219964.F1RRZN743 new file mode 100644 index 0000000..be30207 Binary files /dev/null and b/containercontent/opt/chatbot_engine/prodae/models/train_logs/L47OO2/events.out.tfevents.1644219964.F1RRZN743 differ diff --git a/containercontent/opt/chatbot_engine/prodae/models/train_logs/UW3T36/events.out.tfevents.1644245889.F1RRZN743 b/containercontent/opt/chatbot_engine/prodae/models/train_logs/UW3T36/events.out.tfevents.1644245889.F1RRZN743 new file mode 100644 index 0000000..4e8d5e9 Binary files /dev/null and b/containercontent/opt/chatbot_engine/prodae/models/train_logs/UW3T36/events.out.tfevents.1644245889.F1RRZN743 differ diff --git a/containercontent/opt/chatbot_engine/prodae/models/train_logs/XEXW4D/events.out.tfevents.1644247584.F1RRZN743 b/containercontent/opt/chatbot_engine/prodae/models/train_logs/XEXW4D/events.out.tfevents.1644247584.F1RRZN743 new file mode 100644 index 0000000..2d4dc04 Binary files /dev/null and b/containercontent/opt/chatbot_engine/prodae/models/train_logs/XEXW4D/events.out.tfevents.1644247584.F1RRZN743 differ diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/alerts.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/alerts.less new file mode 100644 index 0000000..c4199db --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/alerts.less @@ -0,0 +1,73 @@ +// +// Alerts +// -------------------------------------------------- + + +// Base styles +// ------------------------- + +.alert { + padding: @alert-padding; + margin-bottom: @line-height-computed; + border: 1px solid transparent; + border-radius: @alert-border-radius; + + // Headings for larger alerts + h4 { + margin-top: 0; + // Specified for the h4 to prevent conflicts of changing @headings-color + color: inherit; + } + + // Provide class for links that match alerts + .alert-link { + font-weight: @alert-link-font-weight; + } + + // Improve alignment and spacing of inner content + > p, + > ul { + margin-bottom: 0; + } + + > p + p { + margin-top: 5px; + } +} + +// Dismissible alerts +// +// Expand the right padding and account for the close button's positioning. + +.alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. +.alert-dismissible { + padding-right: (@alert-padding + 20); + + // Adjust close link position + .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; + } +} + +// Alternate styles +// +// Generate contextual modifier classes for colorizing the alert. + +.alert-success { + .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); +} + +.alert-info { + .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); +} + +.alert-warning { + .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); +} + +.alert-danger { + .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/badges.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/badges.less new file mode 100644 index 0000000..6ee16dc --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/badges.less @@ -0,0 +1,66 @@ +// +// Badges +// -------------------------------------------------- + + +// Base class +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: @font-size-small; + font-weight: @badge-font-weight; + color: @badge-color; + line-height: @badge-line-height; + vertical-align: middle; + white-space: nowrap; + text-align: center; + background-color: @badge-bg; + border-radius: @badge-border-radius; + + // Empty badges collapse automatically (not available in IE8) + &:empty { + display: none; + } + + // Quick fix for badges in buttons + .btn & { + position: relative; + top: -1px; + } + + .btn-xs &, + .btn-group-xs > .btn & { + top: 0; + padding: 1px 5px; + } + + // Hover state, but only for links + a& { + &:hover, + &:focus { + color: @badge-link-hover-color; + text-decoration: none; + cursor: pointer; + } + } + + // Account for badges in navs + .list-group-item.active > &, + .nav-pills > .active > a > & { + color: @badge-active-color; + background-color: @badge-active-bg; + } + + .list-group-item > & { + float: right; + } + + .list-group-item > & + & { + margin-right: 5px; + } + + .nav-pills > li > a > & { + margin-left: 3px; + } +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/bootstrap.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/bootstrap.less new file mode 100644 index 0000000..4b9916e --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/bootstrap.less @@ -0,0 +1,56 @@ +/*! + * Bootstrap v3.3.5 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +// Core variables and mixins +@import "variables.less"; +@import "mixins.less"; + +// Reset and dependencies +@import "normalize.less"; +@import "print.less"; +@import "glyphicons.less"; + +// Core CSS +@import "scaffolding.less"; +@import "type.less"; +@import "code.less"; +@import "grid.less"; +@import "tables.less"; +@import "forms.less"; +@import "buttons.less"; + +// Components +@import "component-animations.less"; +@import "dropdowns.less"; +@import "button-groups.less"; +@import "input-groups.less"; +@import "navs.less"; +@import "navbar.less"; +@import "breadcrumbs.less"; +@import "pagination.less"; +@import "pager.less"; +@import "labels.less"; +@import "badges.less"; +@import "jumbotron.less"; +@import "thumbnails.less"; +@import "alerts.less"; +@import "progress-bars.less"; +@import "media.less"; +@import "list-group.less"; +@import "panels.less"; +@import "responsive-embed.less"; +@import "wells.less"; +@import "close.less"; + +// Components w/ JavaScript +@import "modals.less"; +@import "tooltip.less"; +@import "popovers.less"; +@import "carousel.less"; + +// Utility classes +@import "utilities.less"; +@import "responsive-utilities.less"; diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/breadcrumbs.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/breadcrumbs.less new file mode 100644 index 0000000..cb01d50 --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/breadcrumbs.less @@ -0,0 +1,26 @@ +// +// Breadcrumbs +// -------------------------------------------------- + + +.breadcrumb { + padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; + margin-bottom: @line-height-computed; + list-style: none; + background-color: @breadcrumb-bg; + border-radius: @border-radius-base; + + > li { + display: inline-block; + + + li:before { + content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space + padding: 0 5px; + color: @breadcrumb-color; + } + } + + > .active { + color: @breadcrumb-active-color; + } +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/button-groups.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/button-groups.less new file mode 100644 index 0000000..6a0c5a8 --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/button-groups.less @@ -0,0 +1,244 @@ +// +// Button groups +// -------------------------------------------------- + +// Make the div behave like a button +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; // match .btn alignment given font-size hack above + > .btn { + position: relative; + float: left; + // Bring the "active" button to the front + &:hover, + &:focus, + &:active, + &.active { + z-index: 2; + } + } +} + +// Prevent double borders when buttons are next to each other +.btn-group { + .btn + .btn, + .btn + .btn-group, + .btn-group + .btn, + .btn-group + .btn-group { + margin-left: -1px; + } +} + +// Optional: Group multiple button groups together for a toolbar +.btn-toolbar { + margin-left: -5px; // Offset the first child's margin + &:extend(.clearfix all); + + .btn, + .btn-group, + .input-group { + float: left; + } + > .btn, + > .btn-group, + > .input-group { + margin-left: 5px; + } +} + +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} + +// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match +.btn-group > .btn:first-child { + margin-left: 0; + &:not(:last-child):not(.dropdown-toggle) { + .border-right-radius(0); + } +} +// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + .border-left-radius(0); +} + +// Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group) +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child:not(:last-child) { + > .btn:last-child, + > .dropdown-toggle { + .border-right-radius(0); + } +} +.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { + .border-left-radius(0); +} + +// On active and open, don't show outline +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} + + +// Sizing +// +// Remix the default button sizing classes into new ones for easier manipulation. + +.btn-group-xs > .btn { &:extend(.btn-xs); } +.btn-group-sm > .btn { &:extend(.btn-sm); } +.btn-group-lg > .btn { &:extend(.btn-lg); } + + +// Split button dropdowns +// ---------------------- + +// Give the line between buttons some depth +.btn-group > .btn + .dropdown-toggle { + padding-left: 8px; + padding-right: 8px; +} +.btn-group > .btn-lg + .dropdown-toggle { + padding-left: 12px; + padding-right: 12px; +} + +// The clickable button for toggling the menu +// Remove the gradient and set the same inset shadow as the :active state +.btn-group.open .dropdown-toggle { + .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); + + // Show no shadow for `.btn-link` since it has no other button styles. + &.btn-link { + .box-shadow(none); + } +} + + +// Reposition the caret +.btn .caret { + margin-left: 0; +} +// Carets in other button sizes +.btn-lg .caret { + border-width: @caret-width-large @caret-width-large 0; + border-bottom-width: 0; +} +// Upside down carets for .dropup +.dropup .btn-lg .caret { + border-width: 0 @caret-width-large @caret-width-large; +} + + +// Vertical button groups +// ---------------------- + +.btn-group-vertical { + > .btn, + > .btn-group, + > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; + } + + // Clear floats so dropdown menus can be properly placed + > .btn-group { + &:extend(.clearfix all); + > .btn { + float: none; + } + } + + > .btn + .btn, + > .btn + .btn-group, + > .btn-group + .btn, + > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; + } +} + +.btn-group-vertical > .btn { + &:not(:first-child):not(:last-child) { + border-radius: 0; + } + &:first-child:not(:last-child) { + border-top-right-radius: @btn-border-radius-base; + .border-bottom-radius(0); + } + &:last-child:not(:first-child) { + border-bottom-left-radius: @btn-border-radius-base; + .border-top-radius(0); + } +} +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child:not(:last-child) { + > .btn:last-child, + > .dropdown-toggle { + .border-bottom-radius(0); + } +} +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + .border-top-radius(0); +} + + +// Justified button groups +// ---------------------- + +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; + > .btn, + > .btn-group { + float: none; + display: table-cell; + width: 1%; + } + > .btn-group .btn { + width: 100%; + } + + > .btn-group .dropdown-menu { + left: auto; + } +} + + +// Checkbox and radio options +// +// In order to support the browser's form validation feedback, powered by the +// `required` attribute, we have to "hide" the inputs via `clip`. We cannot use +// `display: none;` or `visibility: hidden;` as that also hides the popover. +// Simply visually hiding the inputs via `opacity` would leave them clickable in +// certain cases which is prevented by using `clip` and `pointer-events`. +// This way, we ensure a DOM element is visible to position the popover from. +// +// See https://github.com/twbs/bootstrap/pull/12794 and +// https://github.com/twbs/bootstrap/pull/14559 for more information. + +[data-toggle="buttons"] { + > .btn, + > .btn-group > .btn { + input[type="radio"], + input[type="checkbox"] { + position: absolute; + clip: rect(0,0,0,0); + pointer-events: none; + } + } +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/buttons.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/buttons.less new file mode 100644 index 0000000..9cbb8f4 --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/buttons.less @@ -0,0 +1,166 @@ +// +// Buttons +// -------------------------------------------------- + + +// Base styles +// -------------------------------------------------- + +.btn { + display: inline-block; + margin-bottom: 0; // For input.btn + font-weight: @btn-font-weight; + text-align: center; + vertical-align: middle; + touch-action: manipulation; + cursor: pointer; + background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 + border: 1px solid transparent; + white-space: nowrap; + .button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @btn-border-radius-base); + .user-select(none); + + &, + &:active, + &.active { + &:focus, + &.focus { + .tab-focus(); + } + } + + &:hover, + &:focus, + &.focus { + color: @btn-default-color; + text-decoration: none; + } + + &:active, + &.active { + outline: 0; + background-image: none; + .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); + } + + &.disabled, + &[disabled], + fieldset[disabled] & { + cursor: @cursor-disabled; + .opacity(.65); + .box-shadow(none); + } + + a& { + &.disabled, + fieldset[disabled] & { + pointer-events: none; // Future-proof disabling of clicks on `` elements + } + } +} + + +// Alternate buttons +// -------------------------------------------------- + +.btn-default { + .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border); +} +.btn-primary { + .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border); +} +// Success appears as green +.btn-success { + .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border); +} +// Info appears as blue-green +.btn-info { + .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border); +} +// Warning appears as orange +.btn-warning { + .button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border); +} +// Danger and error appear as red +.btn-danger { + .button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border); +} + + +// Link buttons +// ------------------------- + +// Make a button look and behave like a link +.btn-link { + color: @link-color; + font-weight: normal; + border-radius: 0; + + &, + &:active, + &.active, + &[disabled], + fieldset[disabled] & { + background-color: transparent; + .box-shadow(none); + } + &, + &:hover, + &:focus, + &:active { + border-color: transparent; + } + &:hover, + &:focus { + color: @link-hover-color; + text-decoration: @link-hover-decoration; + background-color: transparent; + } + &[disabled], + fieldset[disabled] & { + &:hover, + &:focus { + color: @btn-link-disabled-color; + text-decoration: none; + } + } +} + + +// Button Sizes +// -------------------------------------------------- + +.btn-lg { + // line-height: ensure even-numbered height of button next to large input + .button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @btn-border-radius-large); +} +.btn-sm { + // line-height: ensure proper height of button next to small input + .button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small); +} +.btn-xs { + .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small); +} + + +// Block button +// -------------------------------------------------- + +.btn-block { + display: block; + width: 100%; +} + +// Vertically space out multiple block buttons +.btn-block + .btn-block { + margin-top: 5px; +} + +// Specificity overrides +input[type="submit"], +input[type="reset"], +input[type="button"] { + &.btn-block { + width: 100%; + } +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/carousel.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/carousel.less new file mode 100644 index 0000000..87ed696 --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/carousel.less @@ -0,0 +1,269 @@ +// +// Carousel +// -------------------------------------------------- + + +// Wrapper for the slide container and indicators +.carousel { + position: relative; +} + +.carousel-inner { + position: relative; + overflow: hidden; + width: 100%; + + > .item { + display: none; + position: relative; + .transition(.6s ease-in-out left); + + // Account for jankitude on images + > img, + > a > img { + &:extend(.img-responsive); + line-height: 1; + } + + // WebKit CSS3 transforms for supported devices + @media all and (transform-3d), (-webkit-transform-3d) { + .transition-transform(~'0.6s ease-in-out'); + .backface-visibility(~'hidden'); + .perspective(1000px); + + &.next, + &.active.right { + .translate3d(100%, 0, 0); + left: 0; + } + &.prev, + &.active.left { + .translate3d(-100%, 0, 0); + left: 0; + } + &.next.left, + &.prev.right, + &.active { + .translate3d(0, 0, 0); + left: 0; + } + } + } + + > .active, + > .next, + > .prev { + display: block; + } + + > .active { + left: 0; + } + + > .next, + > .prev { + position: absolute; + top: 0; + width: 100%; + } + + > .next { + left: 100%; + } + > .prev { + left: -100%; + } + > .next.left, + > .prev.right { + left: 0; + } + + > .active.left { + left: -100%; + } + > .active.right { + left: 100%; + } + +} + +// Left/right controls for nav +// --------------------------- + +.carousel-control { + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: @carousel-control-width; + .opacity(@carousel-control-opacity); + font-size: @carousel-control-font-size; + color: @carousel-control-color; + text-align: center; + text-shadow: @carousel-text-shadow; + // We can't have this transition here because WebKit cancels the carousel + // animation if you trip this while in the middle of another animation. + + // Set gradients for backgrounds + &.left { + #gradient > .horizontal(@start-color: rgba(0,0,0,.5); @end-color: rgba(0,0,0,.0001)); + } + &.right { + left: auto; + right: 0; + #gradient > .horizontal(@start-color: rgba(0,0,0,.0001); @end-color: rgba(0,0,0,.5)); + } + + // Hover/focus state + &:hover, + &:focus { + outline: 0; + color: @carousel-control-color; + text-decoration: none; + .opacity(.9); + } + + // Toggles + .icon-prev, + .icon-next, + .glyphicon-chevron-left, + .glyphicon-chevron-right { + position: absolute; + top: 50%; + margin-top: -10px; + z-index: 5; + display: inline-block; + } + .icon-prev, + .glyphicon-chevron-left { + left: 50%; + margin-left: -10px; + } + .icon-next, + .glyphicon-chevron-right { + right: 50%; + margin-right: -10px; + } + .icon-prev, + .icon-next { + width: 20px; + height: 20px; + line-height: 1; + font-family: serif; + } + + + .icon-prev { + &:before { + content: '\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039) + } + } + .icon-next { + &:before { + content: '\203a';// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK (U+203A) + } + } +} + +// Optional indicator pips +// +// Add an unordered list with the following class and add a list item for each +// slide your carousel holds. + +.carousel-indicators { + position: absolute; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + margin-left: -30%; + padding-left: 0; + list-style: none; + text-align: center; + + li { + display: inline-block; + width: 10px; + height: 10px; + margin: 1px; + text-indent: -999px; + border: 1px solid @carousel-indicator-border-color; + border-radius: 10px; + cursor: pointer; + + // IE8-9 hack for event handling + // + // Internet Explorer 8-9 does not support clicks on elements without a set + // `background-color`. We cannot use `filter` since that's not viewed as a + // background color by the browser. Thus, a hack is needed. + // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Internet_Explorer + // + // For IE8, we set solid black as it doesn't support `rgba()`. For IE9, we + // set alpha transparency for the best results possible. + background-color: #000 \9; // IE8 + background-color: rgba(0,0,0,0); // IE9 + } + .active { + margin: 0; + width: 12px; + height: 12px; + background-color: @carousel-indicator-active-bg; + } +} + +// Optional captions +// ----------------------------- +// Hidden by default for smaller viewports +.carousel-caption { + position: absolute; + left: 15%; + right: 15%; + bottom: 20px; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: @carousel-caption-color; + text-align: center; + text-shadow: @carousel-text-shadow; + & .btn { + text-shadow: none; // No shadow for button elements in carousel-caption + } +} + + +// Scale up controls for tablets and up +@media screen and (min-width: @screen-sm-min) { + + // Scale up the controls a smidge + .carousel-control { + .glyphicon-chevron-left, + .glyphicon-chevron-right, + .icon-prev, + .icon-next { + width: 30px; + height: 30px; + margin-top: -15px; + font-size: 30px; + } + .glyphicon-chevron-left, + .icon-prev { + margin-left: -15px; + } + .glyphicon-chevron-right, + .icon-next { + margin-right: -15px; + } + } + + // Show and left align the captions + .carousel-caption { + left: 20%; + right: 20%; + padding-bottom: 30px; + } + + // Move up the indicators + .carousel-indicators { + bottom: 20px; + } +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/close.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/close.less new file mode 100644 index 0000000..6d5bfe0 --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/close.less @@ -0,0 +1,34 @@ +// +// Close icons +// -------------------------------------------------- + + +.close { + float: right; + font-size: (@font-size-base * 1.5); + font-weight: @close-font-weight; + line-height: 1; + color: @close-color; + text-shadow: @close-text-shadow; + .opacity(.2); + + &:hover, + &:focus { + color: @close-color; + text-decoration: none; + cursor: pointer; + .opacity(.5); + } + + // Additional properties for button version + // iOS requires the button element instead of an anchor tag. + // If you want the anchor version, it requires `href="#"`. + // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile + button& { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; + } +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/code.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/code.less new file mode 100644 index 0000000..a08b4d4 --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/code.less @@ -0,0 +1,69 @@ +// +// Code (inline and block) +// -------------------------------------------------- + + +// Inline and block code styles +code, +kbd, +pre, +samp { + font-family: @font-family-monospace; +} + +// Inline code +code { + padding: 2px 4px; + font-size: 90%; + color: @code-color; + background-color: @code-bg; + border-radius: @border-radius-base; +} + +// User input typically entered via keyboard +kbd { + padding: 2px 4px; + font-size: 90%; + color: @kbd-color; + background-color: @kbd-bg; + border-radius: @border-radius-small; + box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); + + kbd { + padding: 0; + font-size: 100%; + font-weight: bold; + box-shadow: none; + } +} + +// Blocks of code +pre { + display: block; + padding: ((@line-height-computed - 1) / 2); + margin: 0 0 (@line-height-computed / 2); + font-size: (@font-size-base - 1); // 14px to 13px + line-height: @line-height-base; + word-break: break-all; + word-wrap: break-word; + color: @pre-color; + background-color: @pre-bg; + border: 1px solid @pre-border-color; + border-radius: @border-radius-base; + + // Account for some code outputs that place code tags in pre tags + code { + padding: 0; + font-size: inherit; + color: inherit; + white-space: pre-wrap; + background-color: transparent; + border-radius: 0; + } +} + +// Enable scrollable blocks of code +.pre-scrollable { + max-height: @pre-scrollable-max-height; + overflow-y: scroll; +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/component-animations.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/component-animations.less new file mode 100644 index 0000000..0bcee91 --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/component-animations.less @@ -0,0 +1,33 @@ +// +// Component animations +// -------------------------------------------------- + +// Heads up! +// +// We don't use the `.opacity()` mixin here since it causes a bug with text +// fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. + +.fade { + opacity: 0; + .transition(opacity .15s linear); + &.in { + opacity: 1; + } +} + +.collapse { + display: none; + + &.in { display: block; } + tr&.in { display: table-row; } + tbody&.in { display: table-row-group; } +} + +.collapsing { + position: relative; + height: 0; + overflow: hidden; + .transition-property(~"height, visibility"); + .transition-duration(.35s); + .transition-timing-function(ease); +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/dropdowns.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/dropdowns.less new file mode 100644 index 0000000..f6876c1 --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/dropdowns.less @@ -0,0 +1,216 @@ +// +// Dropdown menus +// -------------------------------------------------- + + +// Dropdown arrow/caret +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: @caret-width-base dashed; + border-top: @caret-width-base solid ~"\9"; // IE8 + border-right: @caret-width-base solid transparent; + border-left: @caret-width-base solid transparent; +} + +// The dropdown wrapper (div) +.dropup, +.dropdown { + position: relative; +} + +// Prevent the focus on the dropdown toggle when closing dropdowns +.dropdown-toggle:focus { + outline: 0; +} + +// The dropdown menu (ul) +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: @zindex-dropdown; + display: none; // none by default, but block on "open" of the menu + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; // override default ul + list-style: none; + font-size: @font-size-base; + text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer) + background-color: @dropdown-bg; + border: 1px solid @dropdown-fallback-border; // IE8 fallback + border: 1px solid @dropdown-border; + border-radius: @border-radius-base; + .box-shadow(0 6px 12px rgba(0,0,0,.175)); + background-clip: padding-box; + + // Aligns the dropdown menu to right + // + // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]` + &.pull-right { + right: 0; + left: auto; + } + + // Dividers (basically an hr) within the dropdown + .divider { + .nav-divider(@dropdown-divider-bg); + } + + // Links within the dropdown menu + > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: @line-height-base; + color: @dropdown-link-color; + white-space: nowrap; // prevent links from randomly breaking onto new lines + } +} + +// Hover/Focus state +.dropdown-menu > li > a { + &:hover, + &:focus { + text-decoration: none; + color: @dropdown-link-hover-color; + background-color: @dropdown-link-hover-bg; + } +} + +// Active state +.dropdown-menu > .active > a { + &, + &:hover, + &:focus { + color: @dropdown-link-active-color; + text-decoration: none; + outline: 0; + background-color: @dropdown-link-active-bg; + } +} + +// Disabled state +// +// Gray out text and ensure the hover/focus state remains gray + +.dropdown-menu > .disabled > a { + &, + &:hover, + &:focus { + color: @dropdown-link-disabled-color; + } + + // Nuke hover/focus effects + &:hover, + &:focus { + text-decoration: none; + background-color: transparent; + background-image: none; // Remove CSS gradient + .reset-filter(); + cursor: @cursor-disabled; + } +} + +// Open state for the dropdown +.open { + // Show the menu + > .dropdown-menu { + display: block; + } + + // Remove the outline when :focus is triggered + > a { + outline: 0; + } +} + +// Menu positioning +// +// Add extra class to `.dropdown-menu` to flip the alignment of the dropdown +// menu with the parent. +.dropdown-menu-right { + left: auto; // Reset the default from `.dropdown-menu` + right: 0; +} +// With v3, we enabled auto-flipping if you have a dropdown within a right +// aligned nav component. To enable the undoing of that, we provide an override +// to restore the default dropdown menu alignment. +// +// This is only for left-aligning a dropdown menu within a `.navbar-right` or +// `.pull-right` nav component. +.dropdown-menu-left { + left: 0; + right: auto; +} + +// Dropdown section headers +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: @font-size-small; + line-height: @line-height-base; + color: @dropdown-header-color; + white-space: nowrap; // as with > li > a +} + +// Backdrop to catch body clicks on mobile, etc. +.dropdown-backdrop { + position: fixed; + left: 0; + right: 0; + bottom: 0; + top: 0; + z-index: (@zindex-dropdown - 10); +} + +// Right aligned dropdowns +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} + +// Allow for dropdowns to go bottom up (aka, dropup-menu) +// +// Just add .dropup after the standard .dropdown class and you're set, bro. +// TODO: abstract this so that the navbar fixed styles are not placed here? + +.dropup, +.navbar-fixed-bottom .dropdown { + // Reverse the caret + .caret { + border-top: 0; + border-bottom: @caret-width-base dashed; + border-bottom: @caret-width-base solid ~"\9"; // IE8 + content: ""; + } + // Different positioning for bottom up menu + .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 2px; + } +} + + +// Component alignment +// +// Reiterate per navbar.less and the modified component alignment there. + +@media (min-width: @grid-float-breakpoint) { + .navbar-right { + .dropdown-menu { + .dropdown-menu-right(); + } + // Necessary for overrides of the default right aligned menu. + // Will remove come v4 in all likelihood. + .dropdown-menu-left { + .dropdown-menu-left(); + } + } +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/forms.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/forms.less new file mode 100644 index 0000000..b064ede --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/forms.less @@ -0,0 +1,607 @@ +// +// Forms +// -------------------------------------------------- + + +// Normalize non-controls +// +// Restyle and baseline non-control form elements. + +fieldset { + padding: 0; + margin: 0; + border: 0; + // Chrome and Firefox set a `min-width: min-content;` on fieldsets, + // so we reset that to ensure it behaves more like a standard block element. + // See https://github.com/twbs/bootstrap/issues/12359. + min-width: 0; +} + +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: @line-height-computed; + font-size: (@font-size-base * 1.5); + line-height: inherit; + color: @legend-color; + border: 0; + border-bottom: 1px solid @legend-border-color; +} + +label { + display: inline-block; + max-width: 100%; // Force IE8 to wrap long content (see https://github.com/twbs/bootstrap/issues/13141) + margin-bottom: 5px; + font-weight: bold; +} + + +// Normalize form controls +// +// While most of our form styles require extra classes, some basic normalization +// is required to ensure optimum display with or without those classes to better +// address browser inconsistencies. + +// Override content-box in Normalize (* isn't specific enough) +input[type="search"] { + .box-sizing(border-box); +} + +// Position radios and checkboxes better +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; // IE8-9 + line-height: normal; +} + +input[type="file"] { + display: block; +} + +// Make range inputs behave like textual form controls +input[type="range"] { + display: block; + width: 100%; +} + +// Make multiple select elements height not fixed +select[multiple], +select[size] { + height: auto; +} + +// Focus for file, radio, and checkbox +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + .tab-focus(); +} + +// Adjust output element +output { + display: block; + padding-top: (@padding-base-vertical + 1); + font-size: @font-size-base; + line-height: @line-height-base; + color: @input-color; +} + + +// Common form controls +// +// Shared size and type resets for form controls. Apply `.form-control` to any +// of the following form controls: +// +// select +// textarea +// input[type="text"] +// input[type="password"] +// input[type="datetime"] +// input[type="datetime-local"] +// input[type="date"] +// input[type="month"] +// input[type="time"] +// input[type="week"] +// input[type="number"] +// input[type="email"] +// input[type="url"] +// input[type="search"] +// input[type="tel"] +// input[type="color"] + +.form-control { + display: block; + width: 100%; + height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border) + padding: @padding-base-vertical @padding-base-horizontal; + font-size: @font-size-base; + line-height: @line-height-base; + color: @input-color; + background-color: @input-bg; + background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 + border: 1px solid @input-border; + border-radius: @input-border-radius; // Note: This has no effect on s in CSS. + .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); + .transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s"); + + // Customize the `:focus` state to imitate native WebKit styles. + .form-control-focus(); + + // Placeholder + .placeholder(); + + // Disabled and read-only inputs + // + // HTML5 says that controls under a fieldset > legend:first-child won't be + // disabled if the fieldset is disabled. Due to implementation difficulty, we + // don't honor that edge case; we style them as disabled anyway. + &[disabled], + &[readonly], + fieldset[disabled] & { + background-color: @input-bg-disabled; + opacity: 1; // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655 + } + + &[disabled], + fieldset[disabled] & { + cursor: @cursor-disabled; + } + + // Reset height for `textarea`s + textarea& { + height: auto; + } +} + + +// Search inputs in iOS +// +// This overrides the extra rounded corners on search inputs in iOS so that our +// `.form-control` class can properly style them. Note that this cannot simply +// be added to `.form-control` as it's not specific enough. For details, see +// https://github.com/twbs/bootstrap/issues/11586. + +input[type="search"] { + -webkit-appearance: none; +} + + +// Special styles for iOS temporal inputs +// +// In Mobile Safari, setting `display: block` on temporal inputs causes the +// text within the input to become vertically misaligned. As a workaround, we +// set a pixel line-height that matches the given height of the input, but only +// for Safari. See https://bugs.webkit.org/show_bug.cgi?id=139848 +// +// Note that as of 8.3, iOS doesn't support `datetime` or `week`. + +@media screen and (-webkit-min-device-pixel-ratio: 0) { + input[type="date"], + input[type="time"], + input[type="datetime-local"], + input[type="month"] { + &.form-control { + line-height: @input-height-base; + } + + &.input-sm, + .input-group-sm & { + line-height: @input-height-small; + } + + &.input-lg, + .input-group-lg & { + line-height: @input-height-large; + } + } +} + + +// Form groups +// +// Designed to help with the organization and spacing of vertical forms. For +// horizontal forms, use the predefined grid classes. + +.form-group { + margin-bottom: @form-group-margin-bottom; +} + + +// Checkboxes and radios +// +// Indent the labels to position radios/checkboxes as hanging controls. + +.radio, +.checkbox { + position: relative; + display: block; + margin-top: 10px; + margin-bottom: 10px; + + label { + min-height: @line-height-computed; // Ensure the input doesn't jump when there is no text + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; + } +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + position: absolute; + margin-left: -20px; + margin-top: 4px \9; +} + +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing +} + +// Radios and checkboxes on same line +.radio-inline, +.checkbox-inline { + position: relative; + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + vertical-align: middle; + font-weight: normal; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; // space out consecutive inline controls +} + +// Apply same disabled cursor tweak as for inputs +// Some special care is needed because Star + +// Import the fonts +@font-face { + font-family: 'Glyphicons Halflings'; + src: url('@{icon-font-path}@{icon-font-name}.eot'); + src: url('@{icon-font-path}@{icon-font-name}.eot?#iefix') format('embedded-opentype'), + url('@{icon-font-path}@{icon-font-name}.woff2') format('woff2'), + url('@{icon-font-path}@{icon-font-name}.woff') format('woff'), + url('@{icon-font-path}@{icon-font-name}.ttf') format('truetype'), + url('@{icon-font-path}@{icon-font-name}.svg#@{icon-font-svg-id}') format('svg'); +} + +// Catchall baseclass +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +// Individual icons +.glyphicon-asterisk { &:before { content: "\2a"; } } +.glyphicon-plus { &:before { content: "\2b"; } } +.glyphicon-euro, +.glyphicon-eur { &:before { content: "\20ac"; } } +.glyphicon-minus { &:before { content: "\2212"; } } +.glyphicon-cloud { &:before { content: "\2601"; } } +.glyphicon-envelope { &:before { content: "\2709"; } } +.glyphicon-pencil { &:before { content: "\270f"; } } +.glyphicon-glass { &:before { content: "\e001"; } } +.glyphicon-music { &:before { content: "\e002"; } } +.glyphicon-search { &:before { content: "\e003"; } } +.glyphicon-heart { &:before { content: "\e005"; } } +.glyphicon-star { &:before { content: "\e006"; } } +.glyphicon-star-empty { &:before { content: "\e007"; } } +.glyphicon-user { &:before { content: "\e008"; } } +.glyphicon-film { &:before { content: "\e009"; } } +.glyphicon-th-large { &:before { content: "\e010"; } } +.glyphicon-th { &:before { content: "\e011"; } } +.glyphicon-th-list { &:before { content: "\e012"; } } +.glyphicon-ok { &:before { content: "\e013"; } } +.glyphicon-remove { &:before { content: "\e014"; } } +.glyphicon-zoom-in { &:before { content: "\e015"; } } +.glyphicon-zoom-out { &:before { content: "\e016"; } } +.glyphicon-off { &:before { content: "\e017"; } } +.glyphicon-signal { &:before { content: "\e018"; } } +.glyphicon-cog { &:before { content: "\e019"; } } +.glyphicon-trash { &:before { content: "\e020"; } } +.glyphicon-home { &:before { content: "\e021"; } } +.glyphicon-file { &:before { content: "\e022"; } } +.glyphicon-time { &:before { content: "\e023"; } } +.glyphicon-road { &:before { content: "\e024"; } } +.glyphicon-download-alt { &:before { content: "\e025"; } } +.glyphicon-download { &:before { content: "\e026"; } } +.glyphicon-upload { &:before { content: "\e027"; } } +.glyphicon-inbox { &:before { content: "\e028"; } } +.glyphicon-play-circle { &:before { content: "\e029"; } } +.glyphicon-repeat { &:before { content: "\e030"; } } +.glyphicon-refresh { &:before { content: "\e031"; } } +.glyphicon-list-alt { &:before { content: "\e032"; } } +.glyphicon-lock { &:before { content: "\e033"; } } +.glyphicon-flag { &:before { content: "\e034"; } } +.glyphicon-headphones { &:before { content: "\e035"; } } +.glyphicon-volume-off { &:before { content: "\e036"; } } +.glyphicon-volume-down { &:before { content: "\e037"; } } +.glyphicon-volume-up { &:before { content: "\e038"; } } +.glyphicon-qrcode { &:before { content: "\e039"; } } +.glyphicon-barcode { &:before { content: "\e040"; } } +.glyphicon-tag { &:before { content: "\e041"; } } +.glyphicon-tags { &:before { content: "\e042"; } } +.glyphicon-book { &:before { content: "\e043"; } } +.glyphicon-bookmark { &:before { content: "\e044"; } } +.glyphicon-print { &:before { content: "\e045"; } } +.glyphicon-camera { &:before { content: "\e046"; } } +.glyphicon-font { &:before { content: "\e047"; } } +.glyphicon-bold { &:before { content: "\e048"; } } +.glyphicon-italic { &:before { content: "\e049"; } } +.glyphicon-text-height { &:before { content: "\e050"; } } +.glyphicon-text-width { &:before { content: "\e051"; } } +.glyphicon-align-left { &:before { content: "\e052"; } } +.glyphicon-align-center { &:before { content: "\e053"; } } +.glyphicon-align-right { &:before { content: "\e054"; } } +.glyphicon-align-justify { &:before { content: "\e055"; } } +.glyphicon-list { &:before { content: "\e056"; } } +.glyphicon-indent-left { &:before { content: "\e057"; } } +.glyphicon-indent-right { &:before { content: "\e058"; } } +.glyphicon-facetime-video { &:before { content: "\e059"; } } +.glyphicon-picture { &:before { content: "\e060"; } } +.glyphicon-map-marker { &:before { content: "\e062"; } } +.glyphicon-adjust { &:before { content: "\e063"; } } +.glyphicon-tint { &:before { content: "\e064"; } } +.glyphicon-edit { &:before { content: "\e065"; } } +.glyphicon-share { &:before { content: "\e066"; } } +.glyphicon-check { &:before { content: "\e067"; } } +.glyphicon-move { &:before { content: "\e068"; } } +.glyphicon-step-backward { &:before { content: "\e069"; } } +.glyphicon-fast-backward { &:before { content: "\e070"; } } +.glyphicon-backward { &:before { content: "\e071"; } } +.glyphicon-play { &:before { content: "\e072"; } } +.glyphicon-pause { &:before { content: "\e073"; } } +.glyphicon-stop { &:before { content: "\e074"; } } +.glyphicon-forward { &:before { content: "\e075"; } } +.glyphicon-fast-forward { &:before { content: "\e076"; } } +.glyphicon-step-forward { &:before { content: "\e077"; } } +.glyphicon-eject { &:before { content: "\e078"; } } +.glyphicon-chevron-left { &:before { content: "\e079"; } } +.glyphicon-chevron-right { &:before { content: "\e080"; } } +.glyphicon-plus-sign { &:before { content: "\e081"; } } +.glyphicon-minus-sign { &:before { content: "\e082"; } } +.glyphicon-remove-sign { &:before { content: "\e083"; } } +.glyphicon-ok-sign { &:before { content: "\e084"; } } +.glyphicon-question-sign { &:before { content: "\e085"; } } +.glyphicon-info-sign { &:before { content: "\e086"; } } +.glyphicon-screenshot { &:before { content: "\e087"; } } +.glyphicon-remove-circle { &:before { content: "\e088"; } } +.glyphicon-ok-circle { &:before { content: "\e089"; } } +.glyphicon-ban-circle { &:before { content: "\e090"; } } +.glyphicon-arrow-left { &:before { content: "\e091"; } } +.glyphicon-arrow-right { &:before { content: "\e092"; } } +.glyphicon-arrow-up { &:before { content: "\e093"; } } +.glyphicon-arrow-down { &:before { content: "\e094"; } } +.glyphicon-share-alt { &:before { content: "\e095"; } } +.glyphicon-resize-full { &:before { content: "\e096"; } } +.glyphicon-resize-small { &:before { content: "\e097"; } } +.glyphicon-exclamation-sign { &:before { content: "\e101"; } } +.glyphicon-gift { &:before { content: "\e102"; } } +.glyphicon-leaf { &:before { content: "\e103"; } } +.glyphicon-fire { &:before { content: "\e104"; } } +.glyphicon-eye-open { &:before { content: "\e105"; } } +.glyphicon-eye-close { &:before { content: "\e106"; } } +.glyphicon-warning-sign { &:before { content: "\e107"; } } +.glyphicon-plane { &:before { content: "\e108"; } } +.glyphicon-calendar { &:before { content: "\e109"; } } +.glyphicon-random { &:before { content: "\e110"; } } +.glyphicon-comment { &:before { content: "\e111"; } } +.glyphicon-magnet { &:before { content: "\e112"; } } +.glyphicon-chevron-up { &:before { content: "\e113"; } } +.glyphicon-chevron-down { &:before { content: "\e114"; } } +.glyphicon-retweet { &:before { content: "\e115"; } } +.glyphicon-shopping-cart { &:before { content: "\e116"; } } +.glyphicon-folder-close { &:before { content: "\e117"; } } +.glyphicon-folder-open { &:before { content: "\e118"; } } +.glyphicon-resize-vertical { &:before { content: "\e119"; } } +.glyphicon-resize-horizontal { &:before { content: "\e120"; } } +.glyphicon-hdd { &:before { content: "\e121"; } } +.glyphicon-bullhorn { &:before { content: "\e122"; } } +.glyphicon-bell { &:before { content: "\e123"; } } +.glyphicon-certificate { &:before { content: "\e124"; } } +.glyphicon-thumbs-up { &:before { content: "\e125"; } } +.glyphicon-thumbs-down { &:before { content: "\e126"; } } +.glyphicon-hand-right { &:before { content: "\e127"; } } +.glyphicon-hand-left { &:before { content: "\e128"; } } +.glyphicon-hand-up { &:before { content: "\e129"; } } +.glyphicon-hand-down { &:before { content: "\e130"; } } +.glyphicon-circle-arrow-right { &:before { content: "\e131"; } } +.glyphicon-circle-arrow-left { &:before { content: "\e132"; } } +.glyphicon-circle-arrow-up { &:before { content: "\e133"; } } +.glyphicon-circle-arrow-down { &:before { content: "\e134"; } } +.glyphicon-globe { &:before { content: "\e135"; } } +.glyphicon-wrench { &:before { content: "\e136"; } } +.glyphicon-tasks { &:before { content: "\e137"; } } +.glyphicon-filter { &:before { content: "\e138"; } } +.glyphicon-briefcase { &:before { content: "\e139"; } } +.glyphicon-fullscreen { &:before { content: "\e140"; } } +.glyphicon-dashboard { &:before { content: "\e141"; } } +.glyphicon-paperclip { &:before { content: "\e142"; } } +.glyphicon-heart-empty { &:before { content: "\e143"; } } +.glyphicon-link { &:before { content: "\e144"; } } +.glyphicon-phone { &:before { content: "\e145"; } } +.glyphicon-pushpin { &:before { content: "\e146"; } } +.glyphicon-usd { &:before { content: "\e148"; } } +.glyphicon-gbp { &:before { content: "\e149"; } } +.glyphicon-sort { &:before { content: "\e150"; } } +.glyphicon-sort-by-alphabet { &:before { content: "\e151"; } } +.glyphicon-sort-by-alphabet-alt { &:before { content: "\e152"; } } +.glyphicon-sort-by-order { &:before { content: "\e153"; } } +.glyphicon-sort-by-order-alt { &:before { content: "\e154"; } } +.glyphicon-sort-by-attributes { &:before { content: "\e155"; } } +.glyphicon-sort-by-attributes-alt { &:before { content: "\e156"; } } +.glyphicon-unchecked { &:before { content: "\e157"; } } +.glyphicon-expand { &:before { content: "\e158"; } } +.glyphicon-collapse-down { &:before { content: "\e159"; } } +.glyphicon-collapse-up { &:before { content: "\e160"; } } +.glyphicon-log-in { &:before { content: "\e161"; } } +.glyphicon-flash { &:before { content: "\e162"; } } +.glyphicon-log-out { &:before { content: "\e163"; } } +.glyphicon-new-window { &:before { content: "\e164"; } } +.glyphicon-record { &:before { content: "\e165"; } } +.glyphicon-save { &:before { content: "\e166"; } } +.glyphicon-open { &:before { content: "\e167"; } } +.glyphicon-saved { &:before { content: "\e168"; } } +.glyphicon-import { &:before { content: "\e169"; } } +.glyphicon-export { &:before { content: "\e170"; } } +.glyphicon-send { &:before { content: "\e171"; } } +.glyphicon-floppy-disk { &:before { content: "\e172"; } } +.glyphicon-floppy-saved { &:before { content: "\e173"; } } +.glyphicon-floppy-remove { &:before { content: "\e174"; } } +.glyphicon-floppy-save { &:before { content: "\e175"; } } +.glyphicon-floppy-open { &:before { content: "\e176"; } } +.glyphicon-credit-card { &:before { content: "\e177"; } } +.glyphicon-transfer { &:before { content: "\e178"; } } +.glyphicon-cutlery { &:before { content: "\e179"; } } +.glyphicon-header { &:before { content: "\e180"; } } +.glyphicon-compressed { &:before { content: "\e181"; } } +.glyphicon-earphone { &:before { content: "\e182"; } } +.glyphicon-phone-alt { &:before { content: "\e183"; } } +.glyphicon-tower { &:before { content: "\e184"; } } +.glyphicon-stats { &:before { content: "\e185"; } } +.glyphicon-sd-video { &:before { content: "\e186"; } } +.glyphicon-hd-video { &:before { content: "\e187"; } } +.glyphicon-subtitles { &:before { content: "\e188"; } } +.glyphicon-sound-stereo { &:before { content: "\e189"; } } +.glyphicon-sound-dolby { &:before { content: "\e190"; } } +.glyphicon-sound-5-1 { &:before { content: "\e191"; } } +.glyphicon-sound-6-1 { &:before { content: "\e192"; } } +.glyphicon-sound-7-1 { &:before { content: "\e193"; } } +.glyphicon-copyright-mark { &:before { content: "\e194"; } } +.glyphicon-registration-mark { &:before { content: "\e195"; } } +.glyphicon-cloud-download { &:before { content: "\e197"; } } +.glyphicon-cloud-upload { &:before { content: "\e198"; } } +.glyphicon-tree-conifer { &:before { content: "\e199"; } } +.glyphicon-tree-deciduous { &:before { content: "\e200"; } } +.glyphicon-cd { &:before { content: "\e201"; } } +.glyphicon-save-file { &:before { content: "\e202"; } } +.glyphicon-open-file { &:before { content: "\e203"; } } +.glyphicon-level-up { &:before { content: "\e204"; } } +.glyphicon-copy { &:before { content: "\e205"; } } +.glyphicon-paste { &:before { content: "\e206"; } } +// The following 2 Glyphicons are omitted for the time being because +// they currently use Unicode codepoints that are outside the +// Basic Multilingual Plane (BMP). Older buggy versions of WebKit can't handle +// non-BMP codepoints in CSS string escapes, and thus can't display these two icons. +// Notably, the bug affects some older versions of the Android Browser. +// More info: https://github.com/twbs/bootstrap/issues/10106 +// .glyphicon-door { &:before { content: "\1f6aa"; } } +// .glyphicon-key { &:before { content: "\1f511"; } } +.glyphicon-alert { &:before { content: "\e209"; } } +.glyphicon-equalizer { &:before { content: "\e210"; } } +.glyphicon-king { &:before { content: "\e211"; } } +.glyphicon-queen { &:before { content: "\e212"; } } +.glyphicon-pawn { &:before { content: "\e213"; } } +.glyphicon-bishop { &:before { content: "\e214"; } } +.glyphicon-knight { &:before { content: "\e215"; } } +.glyphicon-baby-formula { &:before { content: "\e216"; } } +.glyphicon-tent { &:before { content: "\26fa"; } } +.glyphicon-blackboard { &:before { content: "\e218"; } } +.glyphicon-bed { &:before { content: "\e219"; } } +.glyphicon-apple { &:before { content: "\f8ff"; } } +.glyphicon-erase { &:before { content: "\e221"; } } +.glyphicon-hourglass { &:before { content: "\231b"; } } +.glyphicon-lamp { &:before { content: "\e223"; } } +.glyphicon-duplicate { &:before { content: "\e224"; } } +.glyphicon-piggy-bank { &:before { content: "\e225"; } } +.glyphicon-scissors { &:before { content: "\e226"; } } +.glyphicon-bitcoin { &:before { content: "\e227"; } } +.glyphicon-btc { &:before { content: "\e227"; } } +.glyphicon-xbt { &:before { content: "\e227"; } } +.glyphicon-yen { &:before { content: "\00a5"; } } +.glyphicon-jpy { &:before { content: "\00a5"; } } +.glyphicon-ruble { &:before { content: "\20bd"; } } +.glyphicon-rub { &:before { content: "\20bd"; } } +.glyphicon-scale { &:before { content: "\e230"; } } +.glyphicon-ice-lolly { &:before { content: "\e231"; } } +.glyphicon-ice-lolly-tasted { &:before { content: "\e232"; } } +.glyphicon-education { &:before { content: "\e233"; } } +.glyphicon-option-horizontal { &:before { content: "\e234"; } } +.glyphicon-option-vertical { &:before { content: "\e235"; } } +.glyphicon-menu-hamburger { &:before { content: "\e236"; } } +.glyphicon-modal-window { &:before { content: "\e237"; } } +.glyphicon-oil { &:before { content: "\e238"; } } +.glyphicon-grain { &:before { content: "\e239"; } } +.glyphicon-sunglasses { &:before { content: "\e240"; } } +.glyphicon-text-size { &:before { content: "\e241"; } } +.glyphicon-text-color { &:before { content: "\e242"; } } +.glyphicon-text-background { &:before { content: "\e243"; } } +.glyphicon-object-align-top { &:before { content: "\e244"; } } +.glyphicon-object-align-bottom { &:before { content: "\e245"; } } +.glyphicon-object-align-horizontal{ &:before { content: "\e246"; } } +.glyphicon-object-align-left { &:before { content: "\e247"; } } +.glyphicon-object-align-vertical { &:before { content: "\e248"; } } +.glyphicon-object-align-right { &:before { content: "\e249"; } } +.glyphicon-triangle-right { &:before { content: "\e250"; } } +.glyphicon-triangle-left { &:before { content: "\e251"; } } +.glyphicon-triangle-bottom { &:before { content: "\e252"; } } +.glyphicon-triangle-top { &:before { content: "\e253"; } } +.glyphicon-console { &:before { content: "\e254"; } } +.glyphicon-superscript { &:before { content: "\e255"; } } +.glyphicon-subscript { &:before { content: "\e256"; } } +.glyphicon-menu-left { &:before { content: "\e257"; } } +.glyphicon-menu-right { &:before { content: "\e258"; } } +.glyphicon-menu-down { &:before { content: "\e259"; } } +.glyphicon-menu-up { &:before { content: "\e260"; } } diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/grid.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/grid.less new file mode 100644 index 0000000..e100655 --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/grid.less @@ -0,0 +1,84 @@ +// +// Grid system +// -------------------------------------------------- + + +// Container widths +// +// Set the container width, and override it for fixed navbars in media queries. + +.container { + .container-fixed(); + + @media (min-width: @screen-sm-min) { + width: @container-sm; + } + @media (min-width: @screen-md-min) { + width: @container-md; + } + @media (min-width: @screen-lg-min) { + width: @container-lg; + } +} + + +// Fluid container +// +// Utilizes the mixin meant for fixed width containers, but without any defined +// width for fluid, full width layouts. + +.container-fluid { + .container-fixed(); +} + + +// Row +// +// Rows contain and clear the floats of your columns. + +.row { + .make-row(); +} + + +// Columns +// +// Common styles for small and large grid columns + +.make-grid-columns(); + + +// Extra small grid +// +// Columns, offsets, pushes, and pulls for extra small devices like +// smartphones. + +.make-grid(xs); + + +// Small grid +// +// Columns, offsets, pushes, and pulls for the small device range, from phones +// to tablets. + +@media (min-width: @screen-sm-min) { + .make-grid(sm); +} + + +// Medium grid +// +// Columns, offsets, pushes, and pulls for the desktop device range. + +@media (min-width: @screen-md-min) { + .make-grid(md); +} + + +// Large grid +// +// Columns, offsets, pushes, and pulls for the large desktop device range. + +@media (min-width: @screen-lg-min) { + .make-grid(lg); +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/input-groups.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/input-groups.less new file mode 100644 index 0000000..457ea60 --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/input-groups.less @@ -0,0 +1,167 @@ +// +// Input groups +// -------------------------------------------------- + +// Base styles +// ------------------------- +.input-group { + position: relative; // For dropdowns + display: table; + border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table + + // Undo padding and float of grid classes + &[class*="col-"] { + float: none; + padding-left: 0; + padding-right: 0; + } + + .form-control { + // Ensure that the input is always above the *appended* addon button for + // proper border colors. + position: relative; + z-index: 2; + + // IE9 fubars the placeholder attribute in text inputs and the arrows on + // select elements in input groups. To fix it, we float the input. Details: + // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855 + float: left; + + width: 100%; + margin-bottom: 0; + } +} + +// Sizing options +// +// Remix the default form control sizing classes into new ones for easier +// manipulation. + +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + .input-lg(); +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + .input-sm(); +} + + +// Display as table-cell +// ------------------------- +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; + + &:not(:first-child):not(:last-child) { + border-radius: 0; + } +} +// Addon and addon wrapper for buttons +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; // Match the inputs +} + +// Text input groups +// ------------------------- +.input-group-addon { + padding: @padding-base-vertical @padding-base-horizontal; + font-size: @font-size-base; + font-weight: normal; + line-height: 1; + color: @input-color; + text-align: center; + background-color: @input-group-addon-bg; + border: 1px solid @input-group-addon-border-color; + border-radius: @border-radius-base; + + // Sizing + &.input-sm { + padding: @padding-small-vertical @padding-small-horizontal; + font-size: @font-size-small; + border-radius: @border-radius-small; + } + &.input-lg { + padding: @padding-large-vertical @padding-large-horizontal; + font-size: @font-size-large; + border-radius: @border-radius-large; + } + + // Nuke default margins from checkboxes and radios to vertically center within. + input[type="radio"], + input[type="checkbox"] { + margin-top: 0; + } +} + +// Reset rounded corners +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { + .border-right-radius(0); +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { + .border-left-radius(0); +} +.input-group-addon:last-child { + border-left: 0; +} + +// Button input groups +// ------------------------- +.input-group-btn { + position: relative; + // Jankily prevent input button groups from wrapping with `white-space` and + // `font-size` in combination with `inline-block` on buttons. + font-size: 0; + white-space: nowrap; + + // Negative margin for spacing, position for bringing hovered/focused/actived + // element above the siblings. + > .btn { + position: relative; + + .btn { + margin-left: -1px; + } + // Bring the "active" button to the front + &:hover, + &:focus, + &:active { + z-index: 2; + } + } + + // Negative margin to only have a 1px border between the two + &:first-child { + > .btn, + > .btn-group { + margin-right: -1px; + } + } + &:last-child { + > .btn, + > .btn-group { + z-index: 2; + margin-left: -1px; + } + } +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/jumbotron.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/jumbotron.less new file mode 100644 index 0000000..fa80a38 --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/jumbotron.less @@ -0,0 +1,52 @@ +// +// Jumbotron +// -------------------------------------------------- + + +.jumbotron { + padding-top: @jumbotron-padding; + padding-bottom: @jumbotron-padding; + margin-bottom: @jumbotron-padding; + color: @jumbotron-color; + background-color: @jumbotron-bg; + + h1, + .h1 { + color: @jumbotron-heading-color; + } + + p { + margin-bottom: (@jumbotron-padding / 2); + font-size: @jumbotron-font-size; + font-weight: 200; + } + + > hr { + border-top-color: darken(@jumbotron-bg, 10%); + } + + .container &, + .container-fluid & { + border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container + } + + .container { + max-width: 100%; + } + + @media screen and (min-width: @screen-sm-min) { + padding-top: (@jumbotron-padding * 1.6); + padding-bottom: (@jumbotron-padding * 1.6); + + .container &, + .container-fluid & { + padding-left: (@jumbotron-padding * 2); + padding-right: (@jumbotron-padding * 2); + } + + h1, + .h1 { + font-size: @jumbotron-heading-font-size; + } + } +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/labels.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/labels.less new file mode 100644 index 0000000..9a5a270 --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/labels.less @@ -0,0 +1,64 @@ +// +// Labels +// -------------------------------------------------- + +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: @label-color; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; + + // Add hover effects, but only for links + a& { + &:hover, + &:focus { + color: @label-link-hover-color; + text-decoration: none; + cursor: pointer; + } + } + + // Empty labels collapse automatically (not available in IE8) + &:empty { + display: none; + } + + // Quick fix for labels in buttons + .btn & { + position: relative; + top: -1px; + } +} + +// Colors +// Contextual variations (linked labels get darker on :hover) + +.label-default { + .label-variant(@label-default-bg); +} + +.label-primary { + .label-variant(@label-primary-bg); +} + +.label-success { + .label-variant(@label-success-bg); +} + +.label-info { + .label-variant(@label-info-bg); +} + +.label-warning { + .label-variant(@label-warning-bg); +} + +.label-danger { + .label-variant(@label-danger-bg); +} diff --git a/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/list-group.less b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/list-group.less new file mode 100644 index 0000000..216b912 --- /dev/null +++ b/containercontent/opt/chatbot_engine/static/css/font-awesome-4.7.0/bootstrap/list-group.less @@ -0,0 +1,130 @@ +// +// List groups +// -------------------------------------------------- + + +// Base class +// +// Easily usable on