diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..09ca828 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build/deb-rust-proto-interface/rust-proto-interface_safecopy +build/rust-proto-fastapi-server/Prototyp_safecopy diff --git a/build/deb-rust-proto-interface/Dockerfile b/build/deb-rust-proto-interface/Dockerfile index 8cbf3d0..8f74ac6 100644 --- a/build/deb-rust-proto-interface/Dockerfile +++ b/build/deb-rust-proto-interface/Dockerfile @@ -10,7 +10,7 @@ RUN echo "deb http://archive.debian.org/debian stretch main contrib non-free" > RUN apt-get update && apt-get install -y \ build-essential checkinstall zlib1g-dev pkg-config libssl1.0-dev -y -COPY rust-proto-interface rust-proto-interface +#COPY rust-proto-interface rust-proto-interface WORKDIR /opt/rust-proto-interface diff --git a/build/deb-rust-proto-interface/rust-proto-interface/lang.json b/build/deb-rust-proto-interface/rust-proto-interface/lang.json index d7d34fd..e03627a 100644 --- a/build/deb-rust-proto-interface/rust-proto-interface/lang.json +++ b/build/deb-rust-proto-interface/rust-proto-interface/lang.json @@ -36,7 +36,7 @@ "it": "basabuuka" }, "index_title2": { - "en": "Open Language?", + "en": "Open Language!", "fr": "ouvrir la langue?", "de": "Sprache oeffnen?", "it": "Aprire le lingue?" diff --git a/build/deb-rust-proto-interface/rust-proto-interface/templates/index.html b/build/deb-rust-proto-interface/rust-proto-interface/templates/index.html index 3a95962..c29284a 100644 --- a/build/deb-rust-proto-interface/rust-proto-interface/templates/index.html +++ b/build/deb-rust-proto-interface/rust-proto-interface/templates/index.html @@ -147,7 +147,8 @@ if (xhr1.readyState == 4) { result = xhr1.response.split('?&?&') - document.getElementById("output1").value = result[0].substring(3, result[0].length); + + document.getElementById("output1").value = result[0].substring(3, result[0].length).replace(/\n/g, "
"); document.getElementById("output2").value = result[1].substring(0, result[1].length - 3); document.getElementById("datextarea").value = text; }; diff --git a/build/rust-proto-fastapi-server/.Dockerfile.swp b/build/rust-proto-fastapi-server/.Dockerfile.swp deleted file mode 100644 index 8335e8f..0000000 Binary files a/build/rust-proto-fastapi-server/.Dockerfile.swp and /dev/null differ diff --git a/build/rust-proto-fastapi-server/Dockerfile b/build/rust-proto-fastapi-server/Dockerfile index bd62886..db4485b 100644 --- a/build/rust-proto-fastapi-server/Dockerfile +++ b/build/rust-proto-fastapi-server/Dockerfile @@ -11,7 +11,7 @@ FROM tensorflow/tensorflow:2.2.0-gpu #USER pluritonian -WORKDIR /home/pluritonian +WORKDIR /home/pluritonian/Prototyp RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub @@ -29,7 +29,7 @@ RUN python -m spacy download de_core_news_sm RUN pip install --upgrade pip && pip install fastapi uvicorn[standard] -COPY Prototyp/* /home/pluritonian/ +#COPY Prototyp/* /home/pluritonian/ # to let the container running: diff --git a/build/rust-proto-fastapi-server/Prototyp/DataBaseOneZeroshkldbMedio1.hkl b/build/rust-proto-fastapi-server/Prototyp/DataBaseOneZeroshkldbMedio1.hkl index 8c71044..872fee4 100644 Binary files a/build/rust-proto-fastapi-server/Prototyp/DataBaseOneZeroshkldbMedio1.hkl and b/build/rust-proto-fastapi-server/Prototyp/DataBaseOneZeroshkldbMedio1.hkl differ diff --git a/build/rust-proto-fastapi-server/Prototyp/DataBaseOneZeroshkldbMedio2.hkl b/build/rust-proto-fastapi-server/Prototyp/DataBaseOneZeroshkldbMedio2.hkl index 05e2e70..88b235b 100644 Binary files a/build/rust-proto-fastapi-server/Prototyp/DataBaseOneZeroshkldbMedio2.hkl and b/build/rust-proto-fastapi-server/Prototyp/DataBaseOneZeroshkldbMedio2.hkl differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/ConjunctSolve.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/ConjunctSolve.cpython-36.pyc new file mode 100644 index 0000000..90bd8fd Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/ConjunctSolve.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/FASTsearch.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/FASTsearch.cpython-36.pyc new file mode 100644 index 0000000..0be88ed Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/FASTsearch.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/FremdWB.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/FremdWB.cpython-36.pyc new file mode 100644 index 0000000..185e516 Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/FremdWB.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/GS_Utils.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/GS_Utils.cpython-36.pyc new file mode 100644 index 0000000..2cc7524 Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/GS_Utils.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/GenitivSolve.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/GenitivSolve.cpython-36.pyc new file mode 100644 index 0000000..042469b Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/GenitivSolve.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/Medio.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/Medio.cpython-36.pyc new file mode 100644 index 0000000..0642137 Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/Medio.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/Passiv2Aktiv.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/Passiv2Aktiv.cpython-36.pyc new file mode 100644 index 0000000..061c278 Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/Passiv2Aktiv.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/PrototypeAllChained.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/PrototypeAllChained.cpython-36.pyc new file mode 100644 index 0000000..c9e48bb Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/PrototypeAllChained.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/SayYes.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/SayYes.cpython-36.pyc new file mode 100644 index 0000000..5b1d804 Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/SayYes.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/SentGlue.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/SentGlue.cpython-36.pyc new file mode 100644 index 0000000..ba276f1 Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/SentGlue.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/SentSeg.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/SentSeg.cpython-36.pyc new file mode 100644 index 0000000..2c0f61d Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/SentSeg.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/SolveShorts.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/SolveShorts.cpython-36.pyc new file mode 100644 index 0000000..42273dd Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/SolveShorts.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/fastapi_server.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/fastapi_server.cpython-36.pyc new file mode 100644 index 0000000..e0d6ba9 Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/fastapi_server.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/__pycache__/oi.cpython-36.pyc b/build/rust-proto-fastapi-server/Prototyp/__pycache__/oi.cpython-36.pyc new file mode 100644 index 0000000..da512bd Binary files /dev/null and b/build/rust-proto-fastapi-server/Prototyp/__pycache__/oi.cpython-36.pyc differ diff --git a/build/rust-proto-fastapi-server/Prototyp/bagofwordshkldbMedio1.pkl b/build/rust-proto-fastapi-server/Prototyp/bagofwordshkldbMedio1.pkl index a11d945..b0b28a5 100644 Binary files a/build/rust-proto-fastapi-server/Prototyp/bagofwordshkldbMedio1.pkl and b/build/rust-proto-fastapi-server/Prototyp/bagofwordshkldbMedio1.pkl differ diff --git a/build/rust-proto-fastapi-server/Prototyp/bagofwordshkldbMedio2.pkl b/build/rust-proto-fastapi-server/Prototyp/bagofwordshkldbMedio2.pkl index 5b6d4e9..6cba0b7 100644 Binary files a/build/rust-proto-fastapi-server/Prototyp/bagofwordshkldbMedio2.pkl and b/build/rust-proto-fastapi-server/Prototyp/bagofwordshkldbMedio2.pkl differ diff --git a/build/rust-proto-fastapi-server/Prototyp/fastapi_server.py b/build/rust-proto-fastapi-server/Prototyp/fastapi_server.py index 5d689e0..e42d24b 100644 --- a/build/rust-proto-fastapi-server/Prototyp/fastapi_server.py +++ b/build/rust-proto-fastapi-server/Prototyp/fastapi_server.py @@ -62,20 +62,8 @@ async def root(data: Request): output = prototype.translate(text) - print(output) - outputlist = output.split(" ") - rezponse = '' - sentence = '' - for word in outputlist: - - sentence += word - - if '.' or '!' or '?' in word: - rezponse += sentence + ' \n ' - sentence = '' - - daresponse = output + '?&?&' + rezponse + daresponse = output + '?&?&' + "Future Input" return JSONResponse(content=daresponse) diff --git a/build/rust-proto-fastapi-server/Prototyp/prototype_all_chained.py b/build/rust-proto-fastapi-server/Prototyp/prototype_all_chained.py index 4a09b66..35cb675 100644 --- a/build/rust-proto-fastapi-server/Prototyp/prototype_all_chained.py +++ b/build/rust-proto-fastapi-server/Prototyp/prototype_all_chained.py @@ -111,7 +111,7 @@ if len(outsentences) == len(punctuations): for n in range(len(outsentences)): outsentence = outsentences[n] outsentence[0] = outsentence[0].title() - out += ' '.join(outsentence) + punctuations[n] + '\n' + out += ' '.join(outsentence) + punctuations[n] + '
' print(out) diff --git a/compose/docker-compose.yml b/compose/docker-compose.yml index ccdd08c..0398546 100644 --- a/compose/docker-compose.yml +++ b/compose/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.1' - services: @@ -8,6 +6,8 @@ services: build: ../build/rust-proto-fastapi-server container_name: rust-proto-fastapi-server restart: always + volumes: + - ../build/rust-proto-fastapi-server/Prototyp:/home/pluritonian/Prototyp deploy: resources: reservations: @@ -20,6 +20,8 @@ services: build: ../build/deb-rust-proto-interface container_name: deb-rust-proto-interface restart: always + volumes: + - ../build/deb-rust-proto-interface/rust-proto-interface:/opt/rust-proto-interface environment: - RUST_BACKTRACE=full ports: