update: look at todo

main
Thamognya Kodi 2023-01-03 08:57:12 +07:00
parent 1930383a2e
commit f2bad06898
7 changed files with 225 additions and 142 deletions

View File

@ -0,0 +1,51 @@
<template lang="pug">
div(class="lds-ring")
div
div
div
div
</template>
<style lang="scss">
.lds-ring {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}
.lds-ring div {
box-sizing: border-box;
display: block;
position: absolute;
width: 64px;
height: 64px;
margin: 8px;
border: 8px solid #000;
border-radius: 50%;
animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
border-color: #000 transparent transparent;
}
.lds-ring div:nth-child(1) {
animation-delay: -0.45s;
}
.lds-ring div:nth-child(2) {
animation-delay: -0.3s;
}
.lds-ring div:nth-child(3) {
animation-delay: -0.15s;
}
@keyframes lds-ring {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>

View File

@ -44,6 +44,7 @@
"@nuxtjs/eslint-config-typescript": "^11.0.0",
"@nuxtjs/eslint-module": "^3.1.0",
"@nuxtjs/google-fonts": "^2.0.0",
"@nuxtjs/style-resources": "^1.2.1",
"@nuxtjs/stylelint-module": "^4.1.0",
"@nuxtjs/tailwindcss": "^5.3.3",
"@vue/test-utils": "^1.3.0",
@ -61,7 +62,7 @@
"lint-staged": "^13.0.3",
"postcss": "^8.4.20",
"postcss-html": "^1.5.0",
"prettier": "^2.7.1",
"prettier": "^2.8.1",
"sass": "^1.57.1",
"stylelint": "^14.13.0",
"stylelint-config-prettier": "^9.0.3",

View File

@ -1,22 +1,21 @@
<template lang="pug">
div
.grid.grid-cols-1.place-content-center.align-middle.gap-y-10.h-screen.text-center
.grid.grid-cols-1.place-self-center
h1.text-5xl
a.url(href='/') internet-nlp
h1.text-2xl
a.url(href='/') part of internet-ml
.grid.grid-cols-1.gap-y-4.place-items-center(class='md:grid-cols-2')
h1.text-2xl
a.url(href='/nlp/no-context') no context
h1.text-2xl
a.url(href='/nlp/context') context
</template>
<script>
import Vue from 'vue'
export default Vue.extend({
name: 'InternetNLP'
})
</script>
<template lang="pug">
html(lang="en")
body
div(class="grid grid-cols-1 place-content-center align-middle gap-y-10 h-screen text-center")
div(class="grid grid-cols-1 place-self-center")
h1(class="text-5xl")
a(href="/" class="url") internet-nlp
h1(class="text-2xl")
a(href="/" class="url") part of internet-ml
div(class="grid md:grid-cols-2 grid-cols-1 gap-y-4 place-items-center")
h1(class="text-2xl")
a(href="/nlp/no-context" class="url") no context
h1(class="text-2xl")
a(href="/nlp/context" class="url") context
</template>

View File

@ -1,24 +1,23 @@
<template lang="pug">
div
.grid.grid-cols-1.place-content-center.align-middle.gap-y-10.h-screen.text-center
.grid.grid-cols-1.place-self-center
h1.text-5xl
a.url(href='/NLP') Internet-NLP
h1.text-2xl
a.url(href='/NLP/no-context') No context tools
h1.text-2xl
a.url(href='/') Part of Internet-ML
.grid.grid-cols-1.gap-y-4.place-items-center(class='md:grid-cols-2')
h1.text-2xl
a.url(href='/NLP/no-context/question-answer') Question Answering
h1.text-2xl
a.url(href='/NLP/context/NLI') NLI
</template>
<script>
import Vue from 'vue'
export default Vue.extend({
name: 'InternetNLP'
})
</script>
<template lang="pug">
html(lang="en")
body
div(class="grid grid-cols-1 place-content-center align-middle gap-y-10 h-screen text-center")
div(class="grid grid-cols-1 place-self-center")
h1(class="text-5xl")
a(href="/NLP" class="url") Internet-NLP
h1(class="text-2xl")
a(href="/NLP/no-context" class="url") No context tools
h1(class="text-2xl")
a(href="/" class="url") Part of Internet-ML
div(class="grid md:grid-cols-2 grid-cols-1 gap-y-4 place-items-center")
h1(class="text-2xl")
a(href="/NLP/no-context/question-answer" class="url") Question Answering
h1(class="text-2xl")
a(href="/NLP/context/NLI" class="url") NLI
</template>

View File

@ -1,49 +1,41 @@
<template>
<div class="container mx-auto p-4">
<form v-if="!loading" @submit.prevent="submitForm">
<label class="block font-bold text-lg mb-2" for="question"
>Question</label
>
<textarea
id="question"
v-model="form.question"
class="border rounded w-full py-2 px-3"
<template lang="pug">
div
.container.mx-auto.p-4
form(v-if="!loading", @submit.prevent="submitForm")
label.block.font-bold.text-lg.mb-2(for="question") Question
textarea#question.border.rounded.w-full.py-2.px-3(
v-model="form.question",
rows="5"
></textarea>
<button
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
type="submit"
>
Submit
</button>
</form>
<div v-if="loading" class="flex items-center justify-center h-screen">
<div class="lds-ring">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div v-if="answer !== null" class="mt-4 font-bold">
<p>Question: {{ tmpquestion }}</p>
<p class="typed-text">Answer: {{ typedAnswer }}</p>
<p>Urls:</p>
<ul v-if="typedAnswer.length === answer.length && urls !== null">
<li v-for="url in urls" :key="url">
<a :href="url" class="url">- {{ url }}</a>
</li>
</ul>
</div>
</div>
)
button.bg-blue-500.text-white.font-bold.py-2.px-4.rounded(
class="hover:bg-blue-700",
type="submit",
v-if="form.submitCounter < 600"
)
| Submit
p.bg-red-500(v-if="form.submitCounter >= 600") Please wait for sometime as you have made 600 requests within one hour.
.flex.items-center.justify-center.h-screen(v-if="loading")
loadingwheel
.mt-4.font-bold(v-if="answer !== null")
p Question: {{ tmpquestion }}
p.typed-text Answer: {{ typedAnswer }}
p Urls:
ul(v-if="typedAnswer.length === answer.length && urls !== null")
li(v-for="url in urls", :key="url")
a.url(:href="url") - {{ url }}
</template>
<script>
import LoadingWheel from '~/components/LoadingWheel.vue'
export default {
components: { LoadingWheel },
data() {
return {
form: {
question: ''
question: '',
submitCounter: 0
},
answer: null,
loading: false,
@ -51,6 +43,11 @@ export default {
urls: null
}
},
created() {
setInterval(() => {
this.form.submitCounter = 0
}, 3600000)
},
methods: {
resetForm() {
this.form.question = ''
@ -60,6 +57,7 @@ export default {
this.urls = null
},
async submitForm() {
this.form.submitCounter++
this.loading = true
try {
const { data } = await this.$axios.post(
@ -71,13 +69,11 @@ export default {
this.tmpquestion = this.form.question
this.resetForm()
this.answer = data.response.answer
this.loading = false
// console.log(this.answer)
const interval = setInterval(() => {
const typingInterval = setInterval(() => {
this.typedAnswer +=
this.answer[this.typedAnswer.length] || ''
if (this.typedAnswer.length === this.answer.length) {
clearInterval(interval)
clearInterval(typingInterval)
}
}, 150)
this.urls = data.resources
@ -89,49 +85,7 @@ export default {
}
</script>
<style>
.lds-ring {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}
.lds-ring div {
box-sizing: border-box;
display: block;
position: absolute;
width: 64px;
height: 64px;
margin: 8px;
border: 8px solid #000;
border-radius: 50%;
animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
border-color: #000 transparent transparent;
}
.lds-ring div:nth-child(1) {
animation-delay: -0.45s;
}
.lds-ring div:nth-child(2) {
animation-delay: -0.3s;
}
.lds-ring div:nth-child(3) {
animation-delay: -0.15s;
}
@keyframes lds-ring {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
<style lang="scss">
.typed-text {
position: relative;
display: inline;

View File

@ -1,25 +1,23 @@
<template lang="pug">
div
.grid.grid-cols-1.place-content-center.align-middle.gap-y-10.h-screen.text-center
.grid.grid-cols-1.place-self-center
h1.text-5xl
a.url(href='/') Internet-ML
h1.text-xl
a.url(href='https://links.thamognya.com') by Thamognya Kodi
.grid.grid-cols-1.gap-y-4.place-items-center(class='md:grid-cols-3')
h1.text-2xl
a.url(href='/NLP') NLP
h1.text-2xl
a.url(href='/#') Image Generation (in-progress)
h1.text-2xl
a.url(href='/#') Audio (in-progress)
</template>
<script lang="typescript">
import Vue from 'vue'
export default Vue.extend({
name: 'IndexPage'
})
</script>
<template lang="pug">
html(lang="en")
body
//- navbar
div(class="grid grid-cols-1 place-content-center align-middle gap-y-10 h-screen text-center")
div(class="grid grid-cols-1 place-self-center")
h1(class="text-5xl")
a(href="/" class="url") Internet-ML
h1(class="text-xl")
a(href="https://links.thamognya.com" class="url") by Thamognya Kodi
div(class="grid md:grid-cols-3 grid-cols-1 gap-y-4 place-items-center")
h1(class="text-2xl")
a(href="/NLP" class="url") NLP
h1(class="text-2xl")
a(href="/#" class="url") Image Generation (in-progress)
h1(class="text-2xl")
a(href="/#" class="url") Audio (in-progress)
</template>

View File

@ -2069,6 +2069,15 @@
serve-static "^1.14.1"
workbox-cdn "^5.1.4"
"@nuxtjs/style-resources@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@nuxtjs/style-resources/-/style-resources-1.2.1.tgz#9a2b6580b2ed9b06e930bee488a56b8376a263de"
integrity sha512-sOp71gCBNuGK2jchybTtVab83yB7jnSr+hw6DAKDgAGX/jrMYUyxRc9tiFxe+8YDSnqghTgQrkEkqPsfS4D4sg==
dependencies:
consola "^2.15.3"
glob-all "^3.2.1"
sass-resources-loader "^2.2.4"
"@nuxtjs/stylelint-module@^4.1.0":
version "4.1.0"
resolved "https://registry.yarnpkg.com/@nuxtjs/stylelint-module/-/stylelint-module-4.1.0.tgz#2d69dc882a0b2b4391311c405b07d4b39a975ff5"
@ -3409,6 +3418,11 @@ async@^2.6.4:
dependencies:
lodash "^4.17.14"
async@^3.2.3:
version "3.2.4"
resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c"
integrity sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==
asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
@ -4357,6 +4371,15 @@ cli-width@^3.0.0:
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6"
integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==
cliui@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1"
integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==
dependencies:
string-width "^4.2.0"
strip-ansi "^6.0.0"
wrap-ansi "^6.2.0"
cliui@^8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa"
@ -6563,7 +6586,7 @@ gensync@^1.0.0-beta.2:
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==
get-caller-file@^2.0.5:
get-caller-file@^2.0.1, get-caller-file@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
@ -6663,6 +6686,14 @@ gittar@^0.1.1:
mkdirp "^0.5.1"
tar "^4.4.1"
glob-all@^3.2.1:
version "3.3.1"
resolved "https://registry.yarnpkg.com/glob-all/-/glob-all-3.3.1.tgz#6be2d5d8276902319f640fbf839fbe15b35e7667"
integrity sha512-Y+ESjdI7ZgMwfzanHZYQ87C59jOO0i+Hd+QYtVt9PhLi6d8wlOpzQnfBxWUlaTuAoR3TkybLqqbIoWveU4Ji7Q==
dependencies:
glob "^7.2.3"
yargs "^15.3.1"
glob-parent@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae"
@ -6685,7 +6716,7 @@ glob-parent@^6.0.2:
dependencies:
is-glob "^4.0.3"
glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7, glob@^7.2.0:
glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7, glob@^7.2.0, glob@^7.2.3:
version "7.2.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
@ -11303,7 +11334,7 @@ prepend-http@^1.0.0:
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
integrity sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg==
"prettier@^1.18.2 || ^2.0.0", prettier@^2.7.1:
"prettier@^1.18.2 || ^2.0.0", prettier@^2.8.1:
version "2.8.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.1.tgz#4e1fd11c34e2421bc1da9aea9bd8127cd0a35efc"
integrity sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg==
@ -11966,6 +11997,11 @@ require-from-string@^2.0.2:
resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==
require-main-filename@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==
requires-port@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
@ -12181,6 +12217,16 @@ sass-loader@10.1.1:
schema-utils "^3.0.0"
semver "^7.3.2"
sass-resources-loader@^2.2.4:
version "2.2.5"
resolved "https://registry.yarnpkg.com/sass-resources-loader/-/sass-resources-loader-2.2.5.tgz#75131cdb26bae51fcffc007d8155d57b5e825ca7"
integrity sha512-po8rfETH9cOQACWxubT/1CCu77KjxwRtCDm6QAXZH99aUHBydwSoxdIjC40SGp/dcS/FkSNJl0j1VEojGZqlvQ==
dependencies:
async "^3.2.3"
chalk "^4.1.0"
glob "^7.1.6"
loader-utils "^2.0.0"
sass@^1.57.1:
version "1.57.1"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.57.1.tgz#dfafd46eb3ab94817145e8825208ecf7281119b5"
@ -12356,6 +12402,11 @@ server-destroy@^1.0.1:
resolved "https://registry.yarnpkg.com/server-destroy/-/server-destroy-1.0.1.tgz#f13bf928e42b9c3e79383e61cc3998b5d14e6cdd"
integrity sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==
set-blocking@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==
set-value@^2.0.0, set-value@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b"
@ -14317,6 +14368,11 @@ which-boxed-primitive@^1.0.2:
is-string "^1.0.5"
is-symbol "^1.0.3"
which-module@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==
which@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
@ -14502,6 +14558,14 @@ yaml@^2.1.3:
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.2.1.tgz#3014bf0482dcd15147aa8e56109ce8632cd60ce4"
integrity sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==
yargs-parser@^18.1.2:
version "18.1.3"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0"
integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==
dependencies:
camelcase "^5.0.0"
decamelize "^1.2.0"
yargs-parser@^20.2.3:
version "20.2.9"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
@ -14512,6 +14576,23 @@ yargs-parser@^21.0.1, yargs-parser@^21.1.1:
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==
yargs@^15.3.1:
version "15.4.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8"
integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==
dependencies:
cliui "^6.0.0"
decamelize "^1.2.0"
find-up "^4.1.0"
get-caller-file "^2.0.1"
require-directory "^2.1.1"
require-main-filename "^2.0.0"
set-blocking "^2.0.0"
string-width "^4.2.0"
which-module "^2.0.0"
y18n "^4.0.0"
yargs-parser "^18.1.2"
yargs@^17.0.0, yargs@^17.2.1, yargs@^17.3.1:
version "17.6.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541"