dkt-py-bot
commited on
Commit
•
7b7289a
1
Parent(s):
230c88e
Upload 19 files
Browse files- .gitattributes +3 -0
- models_deploy/Untitled.ipynb +196 -0
- models_deploy/app.py +200 -0
- models_deploy/ft_model1.model +3 -0
- models_deploy/ft_model1.model.syn1neg.npy +3 -0
- models_deploy/ft_model1.model.wv.vectors_ngrams.npy +3 -0
- models_deploy/ft_model1.model.wv.vectors_vocab.npy +3 -0
- models_deploy/static/Spin-Cycle-OT/Blue Vinyl License.txt +24 -0
- models_deploy/static/Spin-Cycle-OT/spincycle_3d_ot.otf +0 -0
- models_deploy/static/Spin-Cycle-OT/spincycle_ot.otf +0 -0
- models_deploy/static/css/styles.css +609 -0
- models_deploy/static/images/daisy.png +3 -0
- models_deploy/static/images/logo.png +0 -0
- models_deploy/static/images/nlp.png +3 -0
- models_deploy/static/images/ruva.png +0 -0
- models_deploy/static/images/welcome.png +3 -0
- models_deploy/templates/index.html +377 -0
- models_deploy/w2v_shona2.model +3 -0
- models_deploy/w2v_shona2.model.syn1neg.npy +3 -0
- models_deploy/w2v_shona2.model.wv.vectors.npy +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
models_deploy/static/images/daisy.png filter=lfs diff=lfs merge=lfs -text
|
37 |
+
models_deploy/static/images/nlp.png filter=lfs diff=lfs merge=lfs -text
|
38 |
+
models_deploy/static/images/welcome.png filter=lfs diff=lfs merge=lfs -text
|
models_deploy/Untitled.ipynb
ADDED
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 3,
|
6 |
+
"id": "7f817eb8-9b0a-4340-9c36-8d3eb7f55f97",
|
7 |
+
"metadata": {},
|
8 |
+
"outputs": [],
|
9 |
+
"source": [
|
10 |
+
"import gensim\n",
|
11 |
+
"\n",
|
12 |
+
"# Load the model\n",
|
13 |
+
"ft_model = gensim.models.FastText.load(\"ft_model1.model\")\n",
|
14 |
+
"\n",
|
15 |
+
"\n"
|
16 |
+
]
|
17 |
+
},
|
18 |
+
{
|
19 |
+
"cell_type": "code",
|
20 |
+
"execution_count": 4,
|
21 |
+
"id": "c91f18bf-21e1-4bca-aad6-a4441c079f8f",
|
22 |
+
"metadata": {},
|
23 |
+
"outputs": [
|
24 |
+
{
|
25 |
+
"name": "stdout",
|
26 |
+
"output_type": "stream",
|
27 |
+
"text": [
|
28 |
+
"['vana', 'vakomana']\n",
|
29 |
+
"['vasikana']\n"
|
30 |
+
]
|
31 |
+
}
|
32 |
+
],
|
33 |
+
"source": [
|
34 |
+
"expression = 'vana + vakomana - vasikana'\n",
|
35 |
+
"\n",
|
36 |
+
"positive = []\n",
|
37 |
+
"negative = []\n",
|
38 |
+
"\n",
|
39 |
+
"parts = expression.replace('-', '+-').split('+')\n",
|
40 |
+
"\n",
|
41 |
+
"for part in parts:\n",
|
42 |
+
" part = part.strip()\n",
|
43 |
+
" if part.startswith('-'):\n",
|
44 |
+
" negative.append(part[1:].strip())\n",
|
45 |
+
" elif part:\n",
|
46 |
+
" positive.append(part)\n",
|
47 |
+
"\n",
|
48 |
+
"print(positive)\n",
|
49 |
+
"print(negative)"
|
50 |
+
]
|
51 |
+
},
|
52 |
+
{
|
53 |
+
"cell_type": "code",
|
54 |
+
"execution_count": 7,
|
55 |
+
"id": "a9ffbb58-f536-49e5-8e06-f7a5c9b52326",
|
56 |
+
"metadata": {},
|
57 |
+
"outputs": [
|
58 |
+
{
|
59 |
+
"ename": "ValueError",
|
60 |
+
"evalue": "output array is read-only",
|
61 |
+
"output_type": "error",
|
62 |
+
"traceback": [
|
63 |
+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
64 |
+
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
|
65 |
+
"Cell \u001b[0;32mIn[7], line 6\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m word \u001b[38;5;129;01min\u001b[39;00m positive[\u001b[38;5;241m1\u001b[39m:]:\n\u001b[1;32m 5\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m word \u001b[38;5;129;01min\u001b[39;00m ft_model\u001b[38;5;241m.\u001b[39mwv:\n\u001b[0;32m----> 6\u001b[0m result_vector \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m ft_model\u001b[38;5;241m.\u001b[39mwv\u001b[38;5;241m.\u001b[39mget_vector(word)\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mWord \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mword\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m not in vocabulary\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
|
66 |
+
"\u001b[0;31mValueError\u001b[0m: output array is read-only"
|
67 |
+
]
|
68 |
+
}
|
69 |
+
],
|
70 |
+
"source": [
|
71 |
+
"\n",
|
72 |
+
"result_vector = ft_model.wv.get_vector(positive[0]) \n",
|
73 |
+
"\n",
|
74 |
+
"# Add vectors for positive words\n",
|
75 |
+
"for word in positive[1:]:\n",
|
76 |
+
" if word in ft_model.wv:\n",
|
77 |
+
" result_vector += ft_model.wv.get_vector(word)\n",
|
78 |
+
" else:\n",
|
79 |
+
" raise KeyError(f\"Word '{word}' not in vocabulary\")\n",
|
80 |
+
"\n",
|
81 |
+
"# Subtract vectors for negative words\n",
|
82 |
+
"for word in negative:\n",
|
83 |
+
" if word in ft_model.wv:\n",
|
84 |
+
" result_vector -= ft_model.wv.get_vector(word)\n",
|
85 |
+
" else:\n",
|
86 |
+
" raise KeyError(f\"Word '{word}' not in vocabulary\")\n",
|
87 |
+
"\n",
|
88 |
+
"# Find similar words\n",
|
89 |
+
"result = ft_model.wv.most_similar(positive=[result_vector], topn=top_n)\n",
|
90 |
+
"\n",
|
91 |
+
"# Format the results\n",
|
92 |
+
"response = [{'word': word, 'similarity': similarity} for word, similarity in result]\n",
|
93 |
+
"\n",
|
94 |
+
"\n",
|
95 |
+
"print(response)"
|
96 |
+
]
|
97 |
+
},
|
98 |
+
{
|
99 |
+
"cell_type": "code",
|
100 |
+
"execution_count": 9,
|
101 |
+
"id": "a9c823fa-d1f8-4124-8e60-418986eea4a3",
|
102 |
+
"metadata": {},
|
103 |
+
"outputs": [],
|
104 |
+
"source": [
|
105 |
+
"import numpy as np"
|
106 |
+
]
|
107 |
+
},
|
108 |
+
{
|
109 |
+
"cell_type": "code",
|
110 |
+
"execution_count": 11,
|
111 |
+
"id": "1edd0ca0-38b9-44c8-beb3-25ebc2793223",
|
112 |
+
"metadata": {},
|
113 |
+
"outputs": [
|
114 |
+
{
|
115 |
+
"name": "stdout",
|
116 |
+
"output_type": "stream",
|
117 |
+
"text": [
|
118 |
+
"[{'word': 'vana', 'similarity': 0.92390615}, {'word': 'nhevana', 'similarity': 0.7112871}, {'word': 'twevana', 'similarity': 0.6789861}, {'word': 'vanajib', 'similarity': 0.66515744}, {'word': 'svana', 'similarity': 0.6477824}]\n"
|
119 |
+
]
|
120 |
+
}
|
121 |
+
],
|
122 |
+
"source": [
|
123 |
+
"top_n = 5\n",
|
124 |
+
"if not positive:\n",
|
125 |
+
" raise ValueError(\"Positive word list is empty.\")\n",
|
126 |
+
"if not isinstance(positive, list) or not isinstance(negative, list):\n",
|
127 |
+
" raise TypeError(\"Positive and negative should be lists.\")\n",
|
128 |
+
"\n",
|
129 |
+
"# Initialize result_vector with a writable copy of the first positive word vector\n",
|
130 |
+
"result_vector = ft_model.wv.get_vector(positive[0]).copy() \n",
|
131 |
+
"\n",
|
132 |
+
"# Add vectors for positive words\n",
|
133 |
+
"for word in positive[1:]:\n",
|
134 |
+
" if word in ft_model.wv:\n",
|
135 |
+
" result_vector += ft_model.wv.get_vector(word)\n",
|
136 |
+
" else:\n",
|
137 |
+
" raise KeyError(f\"Word '{word}' not in vocabulary\")\n",
|
138 |
+
"\n",
|
139 |
+
"# Subtract vectors for negative words\n",
|
140 |
+
"for word in negative:\n",
|
141 |
+
" if word in ft_model.wv:\n",
|
142 |
+
" result_vector -= ft_model.wv.get_vector(word)\n",
|
143 |
+
" else:\n",
|
144 |
+
" raise KeyError(f\"Word '{word}' not in vocabulary\")\n",
|
145 |
+
"\n",
|
146 |
+
"# Function to compute cosine similarity between vectors\n",
|
147 |
+
"def cosine_similarity(vec1, vec2):\n",
|
148 |
+
" return np.dot(vec1, vec2) / (np.linalg.norm(vec1) * np.linalg.norm(vec2))\n",
|
149 |
+
"\n",
|
150 |
+
"# Compute cosine similarities between result_vector and all words in the model's vocabulary\n",
|
151 |
+
"cosine_similarities = []\n",
|
152 |
+
"for word in ft_model.wv.index_to_key:\n",
|
153 |
+
" word_vector = ft_model.wv.get_vector(word)\n",
|
154 |
+
" similarity = cosine_similarity(result_vector, word_vector)\n",
|
155 |
+
" cosine_similarities.append((word, similarity))\n",
|
156 |
+
"\n",
|
157 |
+
"# Sort by similarity and return top_n results\n",
|
158 |
+
"sorted_similarities = sorted(cosine_similarities, key=lambda x: x[1], reverse=True)\n",
|
159 |
+
"top_results = sorted_similarities[:top_n]\n",
|
160 |
+
"\n",
|
161 |
+
"# Format the results\n",
|
162 |
+
"response = [{'word': word, 'similarity': similarity} for word, similarity in top_results]\n",
|
163 |
+
"print(response)"
|
164 |
+
]
|
165 |
+
},
|
166 |
+
{
|
167 |
+
"cell_type": "code",
|
168 |
+
"execution_count": null,
|
169 |
+
"id": "7dbc6092-275c-45cf-b137-29908f3d2b73",
|
170 |
+
"metadata": {},
|
171 |
+
"outputs": [],
|
172 |
+
"source": []
|
173 |
+
}
|
174 |
+
],
|
175 |
+
"metadata": {
|
176 |
+
"kernelspec": {
|
177 |
+
"display_name": "Python 3 (ipykernel)",
|
178 |
+
"language": "python",
|
179 |
+
"name": "python3"
|
180 |
+
},
|
181 |
+
"language_info": {
|
182 |
+
"codemirror_mode": {
|
183 |
+
"name": "ipython",
|
184 |
+
"version": 3
|
185 |
+
},
|
186 |
+
"file_extension": ".py",
|
187 |
+
"mimetype": "text/x-python",
|
188 |
+
"name": "python",
|
189 |
+
"nbconvert_exporter": "python",
|
190 |
+
"pygments_lexer": "ipython3",
|
191 |
+
"version": "3.12.3"
|
192 |
+
}
|
193 |
+
},
|
194 |
+
"nbformat": 4,
|
195 |
+
"nbformat_minor": 5
|
196 |
+
}
|
models_deploy/app.py
ADDED
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from flask import Flask, request, jsonify, render_template
|
2 |
+
import gensim
|
3 |
+
from gensim.models import FastText
|
4 |
+
from threading import Thread
|
5 |
+
import numpy as np
|
6 |
+
from flask_mail import Mail, Message
|
7 |
+
|
8 |
+
app = Flask(__name__)
|
9 |
+
|
10 |
+
class ModelLoader(Thread):
|
11 |
+
def __init__(self, model_type, model_path):
|
12 |
+
super().__init__()
|
13 |
+
self.model_type = model_type
|
14 |
+
self.model_path = model_path
|
15 |
+
self.model = None
|
16 |
+
|
17 |
+
def run(self):
|
18 |
+
# Load the model
|
19 |
+
if self.model_type == 'fasttext':
|
20 |
+
self.model = gensim.models.FastText.load(self.model_path)
|
21 |
+
elif self.model_type == 'word2vec':
|
22 |
+
self.model = gensim.models.Word2Vec.load(self.model_path)
|
23 |
+
else:
|
24 |
+
raise ValueError("Unsupported model type")
|
25 |
+
|
26 |
+
# Initialize model loader threads with local paths
|
27 |
+
word2vec_loader = ModelLoader('word2vec', 'w2v_shona2.model')
|
28 |
+
fasttext_loader = ModelLoader('fasttext', 'ft_model1.model')
|
29 |
+
|
30 |
+
# Start loading models in the background
|
31 |
+
word2vec_loader.start()
|
32 |
+
fasttext_loader.start()
|
33 |
+
|
34 |
+
@app.route('/')
|
35 |
+
def home():
|
36 |
+
return render_template('index.html')
|
37 |
+
|
38 |
+
|
39 |
+
# GETTING SIMILAR WORDS
|
40 |
+
@app.route('/get_similar_words', methods=['POST'])
|
41 |
+
def get_similar_words():
|
42 |
+
word = request.json.get('word')
|
43 |
+
model_type = request.json.get('model_type')
|
44 |
+
top_n = int(request.json.get('top_n', 10)) # Default to 10 if not provided
|
45 |
+
|
46 |
+
if model_type == 'word2vec':
|
47 |
+
if word2vec_loader.model is None:
|
48 |
+
return jsonify({'error': 'Word2Vec model is still loading'}), 503
|
49 |
+
try:
|
50 |
+
similar_words = word2vec_loader.model.wv.most_similar(word, topn=top_n)
|
51 |
+
return jsonify({'similar_words': similar_words})
|
52 |
+
except KeyError:
|
53 |
+
return jsonify({'error': 'Word not found in Word2Vec model'}), 404
|
54 |
+
elif model_type == 'fasttext':
|
55 |
+
if fasttext_loader.model is None:
|
56 |
+
return jsonify({'error': 'FastText model is still loading'}), 503
|
57 |
+
try:
|
58 |
+
similar_words = fasttext_loader.model.wv.most_similar(word, topn=top_n)
|
59 |
+
return jsonify({'similar_words': similar_words})
|
60 |
+
except KeyError:
|
61 |
+
return jsonify({'error': 'Word not found in FastText model'}), 404
|
62 |
+
else:
|
63 |
+
return jsonify({'error': 'Invalid model type'}), 400
|
64 |
+
|
65 |
+
|
66 |
+
|
67 |
+
# COMPUTATIONS
|
68 |
+
@app.route('/compute', methods=['POST'])
|
69 |
+
def compute():
|
70 |
+
data = request.json
|
71 |
+
expression = data.get('expression')
|
72 |
+
model_type = data.get('model')
|
73 |
+
top_n = int(data.get('top_n', 5))
|
74 |
+
|
75 |
+
positive = []
|
76 |
+
negative = []
|
77 |
+
|
78 |
+
# Parse the expression into positive and negative lists
|
79 |
+
parts = expression.replace('-', '+-').split('+')
|
80 |
+
|
81 |
+
for part in parts:
|
82 |
+
part = part.strip()
|
83 |
+
if part.startswith('-'):
|
84 |
+
negative.append(part[1:].strip())
|
85 |
+
elif part:
|
86 |
+
positive.append(part)
|
87 |
+
|
88 |
+
# Load the appropriate model and process
|
89 |
+
if model_type == 'word2vec':
|
90 |
+
if word2vec_loader.model is None:
|
91 |
+
return jsonify({'error': 'Word2Vec model is still loading'}), 503
|
92 |
+
try:
|
93 |
+
result = word2vec_loader.model.wv.most_similar(positive=positive, negative=negative, topn=top_n)
|
94 |
+
response = [{'word': word, 'similarity': similarity} for word, similarity in result]
|
95 |
+
except Exception as e:
|
96 |
+
response = {'error': str(e)}
|
97 |
+
|
98 |
+
elif model_type == 'fasttext':
|
99 |
+
try:
|
100 |
+
# Check if model is loaded properly
|
101 |
+
if fasttext_loader.model is None:
|
102 |
+
raise ValueError("The FastText model is not loaded properly.")
|
103 |
+
if not hasattr(fasttext_loader.model, 'wv'):
|
104 |
+
raise TypeError("The loaded model does not have the 'wv' attribute.")
|
105 |
+
|
106 |
+
if not positive:
|
107 |
+
raise ValueError("Positive word list is empty.")
|
108 |
+
if not isinstance(positive, list) or not isinstance(negative, list):
|
109 |
+
raise TypeError("Positive and negative should be lists.")
|
110 |
+
|
111 |
+
# Initialize result_vector with a writable copy of the first positive word vector
|
112 |
+
result_vector = fasttext_loader.model.wv.get_vector(positive[0]).copy()
|
113 |
+
|
114 |
+
# Add vectors for positive words
|
115 |
+
for word in positive[1:]:
|
116 |
+
if word in fasttext_loader.model.wv:
|
117 |
+
result_vector += fasttext_loader.model.wv.get_vector(word)
|
118 |
+
else:
|
119 |
+
raise KeyError(f"Word '{word}' not in vocabulary")
|
120 |
+
|
121 |
+
# Subtract vectors for negative words
|
122 |
+
for word in negative:
|
123 |
+
if word in fasttext_loader.model.wv:
|
124 |
+
result_vector -= fasttext_loader.model.wv.get_vector(word)
|
125 |
+
else:
|
126 |
+
raise KeyError(f"Word '{word}' not in vocabulary")
|
127 |
+
|
128 |
+
# Find similar words
|
129 |
+
result = fasttext_loader.model.wv.most_similar(positive=[result_vector], topn=top_n)
|
130 |
+
|
131 |
+
# Format the results
|
132 |
+
response = [{'word': word, 'similarity': similarity} for word, similarity in result]
|
133 |
+
|
134 |
+
except KeyError as e:
|
135 |
+
response = {'error': f"KeyError: {str(e)}"}
|
136 |
+
except ValueError as e:
|
137 |
+
response = {'error': f"ValueError: {str(e)}"}
|
138 |
+
except TypeError as e:
|
139 |
+
response = {'error': f"TypeError: {str(e)}"}
|
140 |
+
except Exception as e:
|
141 |
+
response = {'error': f"An unexpected error occurred: {str(e)}"}
|
142 |
+
|
143 |
+
|
144 |
+
return jsonify(response)
|
145 |
+
|
146 |
+
else:
|
147 |
+
return jsonify({'error': 'Invalid model type'})
|
148 |
+
|
149 |
+
return jsonify(response)
|
150 |
+
|
151 |
+
|
152 |
+
|
153 |
+
|
154 |
+
|
155 |
+
|
156 |
+
|
157 |
+
|
158 |
+
# Configure Flask-Mail
|
159 |
+
app.config['MAIL_SERVER'] = 'smtp.gmail.com' # Replace with your mail server
|
160 |
+
app.config['MAIL_PORT'] = 587 # Typically 587 for TLS, or 465 for SSL
|
161 |
+
app.config['MAIL_USERNAME'] = 'tsenesakudzai@gmail.com' # Replace with your email address
|
162 |
+
app.config['MAIL_PASSWORD'] = 'jphs dnyg buph srjf' # Replace with your email password
|
163 |
+
app.config['MAIL_USE_TLS'] = True
|
164 |
+
app.config['MAIL_USE_SSL'] = False
|
165 |
+
|
166 |
+
mail = Mail(app)
|
167 |
+
|
168 |
+
@app.route('/submit', methods=['POST'])
|
169 |
+
def submit():
|
170 |
+
# Extract data from the form
|
171 |
+
name = request.form.get('name')
|
172 |
+
email = request.form.get('email')
|
173 |
+
message = request.form.get('message')
|
174 |
+
subscribe = 'subscribe' in request.form
|
175 |
+
|
176 |
+
# Create and send the email
|
177 |
+
try:
|
178 |
+
msg = Message(
|
179 |
+
subject='Contact Form Submission',
|
180 |
+
sender=email, # Replace with your email address
|
181 |
+
recipients=[app.config['MAIL_USERNAME']], # Replace with recipient's email address
|
182 |
+
body=f"Name: {name}\nEmail: {email}\nMessage: {message}\nSubscribe: {subscribe}"
|
183 |
+
)
|
184 |
+
mail.send(msg)
|
185 |
+
except Exception as e:
|
186 |
+
return jsonify({
|
187 |
+
'status': 'error',
|
188 |
+
'message': f'An error occurred while sending the email: {str(e)}'
|
189 |
+
})
|
190 |
+
|
191 |
+
# Return a response
|
192 |
+
return jsonify({
|
193 |
+
'status': 'success',
|
194 |
+
'message': 'Your message has been received and the email has been sent!'
|
195 |
+
})
|
196 |
+
|
197 |
+
|
198 |
+
|
199 |
+
if __name__ == '__main__':
|
200 |
+
app.run(debug=True)
|
models_deploy/ft_model1.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d14af919861c3949fe848086fcf62cbd094fd017951f0b562d5be83dcab4f839
|
3 |
+
size 6943937
|
models_deploy/ft_model1.model.syn1neg.npy
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ce6c2c493cb87dbacfeb0c645e3575cdd262b7a132846a3ea1ebfdabdcfa8ec9
|
3 |
+
size 221613728
|
models_deploy/ft_model1.model.wv.vectors_ngrams.npy
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6f03d9d8db715ebd30cad9a3eeadc025599302bd88cb3909ecb0e4e16593036f
|
3 |
+
size 2400000128
|
models_deploy/ft_model1.model.wv.vectors_vocab.npy
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fa9dd6e2da7a804fdd8b4e490bec3f9f1aae7bd1e98c1c5d9fcb3a4cd5aa4256
|
3 |
+
size 221613728
|
models_deploy/static/Spin-Cycle-OT/Blue Vinyl License.txt
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Blue Vinyl Fonts
|
2 |
+
(c) 2008 All Rights Reserved
|
3 |
+
bvfonts.com
|
4 |
+
|
5 |
+
The Freeware Font(s) included in this pack were created by Jess Latham. I am inspired by my uncontrolable love for music and graphic design. All fonts are original works.
|
6 |
+
|
7 |
+
Please do not include this font on any CD-ROM compilations. This font is not to be resold or remarketed. This font is free to use in any private and commercial manner. If you plan to use this font commercially and would like to say thanks for the free font you can purchase a pay font from bvfonts.com and I would be very grateful.
|
8 |
+
|
9 |
+
Please read the legal notice below. Basically what it is saying is that I'm human and although I work very hard to make fonts that work well, I'm not perfect.
|
10 |
+
|
11 |
+
NO WARRANTIES. Blue Vinyl Fonts expressly disclaims any warranty for this SOFTWARE PRODUCT. This SOFTWARE PRODUCT and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or noninfringement. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you.
|
12 |
+
|
13 |
+
NO LIABILITY FOR CONSEQUENTIAL DAMAGES. In no event shall Blue Vinyl Fonts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this product, even if Blue Vinyl Fonts has been advised of the possibility of such damages.
|
14 |
+
|
15 |
+
UNDER NO CIRCUMSTANCES SHOULD THESE FONTS BE USED IN A SITUATION THAT COULD ENDANGER LIFE OR THE ENVIROMENT. FOR INSTANCE AIRPLANE NAVIGATION, SAFETY SIGNS, etc.
|
16 |
+
|
17 |
+
EDUCATIONAL PURPOSES: If this font is used in an educational situation it is up to you the user or teacher to confirm that they are useful and you take full responsibility for it's use.
|
18 |
+
|
19 |
+
Blue Vinyl Fonts reserves the right to make changes to this license at any time.
|
20 |
+
|
21 |
+
Have questions? Please visit bvfonts.com and click the email me link. I love hearing from you!
|
22 |
+
|
23 |
+
- Jess Latham
|
24 |
+
Blue Vinyl Fonts
|
models_deploy/static/Spin-Cycle-OT/spincycle_3d_ot.otf
ADDED
Binary file (44.6 kB). View file
|
|
models_deploy/static/Spin-Cycle-OT/spincycle_ot.otf
ADDED
Binary file (28.7 kB). View file
|
|
models_deploy/static/css/styles.css
ADDED
@@ -0,0 +1,609 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
@font-face {
|
3 |
+
font-family: 'Source Sans Pro';
|
4 |
+
src: url('source-sans-pro/SourceSansPro-Regular.otf') format('truetype');
|
5 |
+
font-weight: normal;
|
6 |
+
font-style: normal;
|
7 |
+
}
|
8 |
+
|
9 |
+
body{
|
10 |
+
display: flex;
|
11 |
+
flex-direction: column;
|
12 |
+
margin: 0;
|
13 |
+
/*background-color: black;*/
|
14 |
+
background: linear-gradient(to bottom,#060213, #000000, #111b1b,#060213, #1c1c1a , rgb(5, 5, 25));
|
15 |
+
}
|
16 |
+
/* 1. ---- WELCOME SECTION ---- */
|
17 |
+
/* header */
|
18 |
+
#welcome {
|
19 |
+
/* background-color: black;*/
|
20 |
+
background: linear-gradient(to bottom, #000000, rgb(8, 8, 61), #180d4b, #000000);
|
21 |
+
height: 850px;
|
22 |
+
margin-bottom: 0;
|
23 |
+
}
|
24 |
+
header{
|
25 |
+
padding-left: 80px;
|
26 |
+
padding-right: 80px;
|
27 |
+
padding-top: 20px;
|
28 |
+
|
29 |
+
}
|
30 |
+
nav{
|
31 |
+
display: flex;
|
32 |
+
justify-content: space-between;
|
33 |
+
align-items: center;
|
34 |
+
|
35 |
+
}
|
36 |
+
|
37 |
+
.logo{
|
38 |
+
display: flex;
|
39 |
+
align-items: center;
|
40 |
+
}
|
41 |
+
|
42 |
+
.logo p{
|
43 |
+
font-family: 'Jacques Francois Shadow', serif;
|
44 |
+
font-size: 24px;
|
45 |
+
color: white;
|
46 |
+
}
|
47 |
+
|
48 |
+
nav img{
|
49 |
+
height: 47px;
|
50 |
+
width: 40px;
|
51 |
+
}
|
52 |
+
|
53 |
+
nav ul {
|
54 |
+
list-style: none;
|
55 |
+
display: flex;
|
56 |
+
font-family: 'Jacques Francois', serif;
|
57 |
+
font-size: 24px;
|
58 |
+
gap: 40px;
|
59 |
+
}
|
60 |
+
|
61 |
+
nav ul li a{
|
62 |
+
text-decoration: none; /* remove the underline*/
|
63 |
+
color: white;
|
64 |
+
}
|
65 |
+
|
66 |
+
nav ul li a::before{
|
67 |
+
color: white;
|
68 |
+
}
|
69 |
+
nav ul li a::after{
|
70 |
+
color: rgb(17, 23, 138);
|
71 |
+
}
|
72 |
+
|
73 |
+
nav ul li a:hover{
|
74 |
+
color:rgb(162, 23, 23);
|
75 |
+
}
|
76 |
+
|
77 |
+
#welcome hr{
|
78 |
+
margin-top: 0;
|
79 |
+
padding-bottom: 30px;
|
80 |
+
border: none;
|
81 |
+
border-top: 1px solid white; /* Adjust color and thickness */
|
82 |
+
margin: 10px 0; /* Adjust spacing around the line */
|
83 |
+
|
84 |
+
}
|
85 |
+
|
86 |
+
/* welcome message */
|
87 |
+
.welcomeMsg{
|
88 |
+
max-height: 850px;
|
89 |
+
padding-left: 80px;
|
90 |
+
padding-right: 80px;
|
91 |
+
padding-top: 36px;
|
92 |
+
position: relative;
|
93 |
+
margin: 0;
|
94 |
+
}
|
95 |
+
.welcomeMsg img{
|
96 |
+
height: auto;
|
97 |
+
width:100%;
|
98 |
+
display: block;
|
99 |
+
margin: 0;
|
100 |
+
}
|
101 |
+
|
102 |
+
.rectangle {
|
103 |
+
position: absolute;
|
104 |
+
top: 130px;
|
105 |
+
left: 150px;
|
106 |
+
width: 590px;
|
107 |
+
height: 500px;
|
108 |
+
background: linear-gradient(to bottom,#0A215C 0%, #0B2464 7%, #333d57 23%, #17254c 57%);
|
109 |
+
}
|
110 |
+
|
111 |
+
#welcome h1{
|
112 |
+
position: absolute;
|
113 |
+
top: 70px;
|
114 |
+
left: 230px;
|
115 |
+
width: 400px;
|
116 |
+
height: 420px;
|
117 |
+
color: #FFFFFF;
|
118 |
+
font-family: 'Kavoon';
|
119 |
+
font-size: 78px;
|
120 |
+
text-align: center;
|
121 |
+
/* animation: fadeInOut 5s infinite; */
|
122 |
+
|
123 |
+
}
|
124 |
+
|
125 |
+
@keyframes fadeInOut {
|
126 |
+
0% {
|
127 |
+
opacity: 1;
|
128 |
+
}
|
129 |
+
50% {
|
130 |
+
opacity: 0.4;
|
131 |
+
}
|
132 |
+
100% {
|
133 |
+
opacity: 1;
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
|
138 |
+
.container {
|
139 |
+
position: absolute;
|
140 |
+
width: 500px;
|
141 |
+
height: 250px;
|
142 |
+
top: 350px;
|
143 |
+
left: 200px;
|
144 |
+
}
|
145 |
+
|
146 |
+
.ellipse {
|
147 |
+
position: absolute;
|
148 |
+
border-radius: 50%;
|
149 |
+
width: 100%;
|
150 |
+
height: 100%;
|
151 |
+
background-color: #4B64A3;
|
152 |
+
|
153 |
+
}
|
154 |
+
.ellipse.top:hover {
|
155 |
+
transform: scale(1.1); /* Increase size by 10% */
|
156 |
+
}
|
157 |
+
|
158 |
+
.ellipse.top {
|
159 |
+
width: 88%;
|
160 |
+
height: 88%;
|
161 |
+
top: 8%;
|
162 |
+
left: 8%;
|
163 |
+
/* background-color: rgba(255, 255, 255, 0.5); */
|
164 |
+
background: linear-gradient(to bottom,#0A215C 0%, #0B2464 7%, #333d57 23%, #17254c 57%);
|
165 |
+
display: flex;
|
166 |
+
justify-content: center;
|
167 |
+
align-items: center;
|
168 |
+
color: #0A215C;
|
169 |
+
transition: transform 0.3s ease;
|
170 |
+
}
|
171 |
+
|
172 |
+
.text {
|
173 |
+
font-size: 20px;
|
174 |
+
color: whitesmoke;
|
175 |
+
padding-left: 12px;
|
176 |
+
padding-right: 10px;
|
177 |
+
max-width: 80%;
|
178 |
+
word-wrap: break-word;
|
179 |
+
text-align: center;
|
180 |
+
/* animation: fadeInOut 4s infinite; */
|
181 |
+
font-family: 'Kavoon';
|
182 |
+
}
|
183 |
+
|
184 |
+
|
185 |
+
|
186 |
+
|
187 |
+
|
188 |
+
|
189 |
+
|
190 |
+
/* 2. EMBEDDINGS SECTION */
|
191 |
+
#embeddings {
|
192 |
+
/*background-color: #3AA69D;*/
|
193 |
+
background: linear-gradient(to bottom,#0f062c, #000000, #325452, #020212);
|
194 |
+
|
195 |
+
height: 850px;
|
196 |
+
position: relative;
|
197 |
+
width: 90.5%;
|
198 |
+
align-self: center;
|
199 |
+
margin-top: 0;
|
200 |
+
display: flex;
|
201 |
+
flex-direction: column;
|
202 |
+
|
203 |
+
}
|
204 |
+
|
205 |
+
#embeddings h1{
|
206 |
+
position: absolute;
|
207 |
+
color:#FFFFFF;
|
208 |
+
font-family: "Kavoon";
|
209 |
+
top:170px;
|
210 |
+
left:180px;
|
211 |
+
font-size: 64px;
|
212 |
+
transition: transform 0.5s ease;
|
213 |
+
animation: fadeInOut 5s infinite;
|
214 |
+
}
|
215 |
+
|
216 |
+
#embeddings h1:hover {
|
217 |
+
transform: scale(1.1); /* Increase size by 10% */
|
218 |
+
color: #9c7a7a;
|
219 |
+
}
|
220 |
+
|
221 |
+
#embeddings img{
|
222 |
+
height: auto;
|
223 |
+
width:100%;
|
224 |
+
display: block;
|
225 |
+
align-self: center;
|
226 |
+
padding-top: 100px;
|
227 |
+
}
|
228 |
+
|
229 |
+
.generate{
|
230 |
+
position: absolute;
|
231 |
+
height: 450px;
|
232 |
+
width: 86%;
|
233 |
+
/* background-color: #d7d2d2; /* remove color */
|
234 |
+
top:50%;
|
235 |
+
align-self: center;
|
236 |
+
display: flex;
|
237 |
+
justify-content: space-between;
|
238 |
+
}
|
239 |
+
|
240 |
+
.word {
|
241 |
+
display: flex;
|
242 |
+
flex-direction: column;
|
243 |
+
/*background-color: #526392; remove color */
|
244 |
+
height: auto;
|
245 |
+
width: 90%;
|
246 |
+
margin-left: 60px;
|
247 |
+
}
|
248 |
+
|
249 |
+
.btns1{
|
250 |
+
display: flex;
|
251 |
+
justify-content: space-between;
|
252 |
+
margin-right: 20px;
|
253 |
+
margin-top: 20px;
|
254 |
+
|
255 |
+
|
256 |
+
}
|
257 |
+
|
258 |
+
|
259 |
+
.result1{
|
260 |
+
display: flex;
|
261 |
+
flex-direction: column;
|
262 |
+
/* background-color: #0F296B; remove color */
|
263 |
+
background: linear-gradient(to bottom, #0F296B, black, #325452, #101a1a);
|
264 |
+
height: auto;
|
265 |
+
width: 40%;
|
266 |
+
margin-right: 60px;
|
267 |
+
align-items: center;
|
268 |
+
color:black;
|
269 |
+
margin-bottom: 25px;
|
270 |
+
|
271 |
+
}
|
272 |
+
.type-word input{
|
273 |
+
height: 120px;
|
274 |
+
width: 98%;
|
275 |
+
margin-top: 120px;
|
276 |
+
border-radius: 5px;
|
277 |
+
font-size: 24px;
|
278 |
+
text-wrap:balance;
|
279 |
+
}
|
280 |
+
|
281 |
+
|
282 |
+
.model{
|
283 |
+
height:50px;
|
284 |
+
background-color: #4BD28A;
|
285 |
+
width:220px;
|
286 |
+
display: flex;
|
287 |
+
justify-content: space-between;
|
288 |
+
font-size: 20px;
|
289 |
+
align-items: center;
|
290 |
+
padding-right: 10px;
|
291 |
+
padding-left: 10px;
|
292 |
+
margin-left: 10px;
|
293 |
+
border-radius: 5px;
|
294 |
+
}
|
295 |
+
.model:hover{
|
296 |
+
background-color: #0f8d17;
|
297 |
+
color: white;
|
298 |
+
transition: background-color 0.3s ease, color 0.3s ease;
|
299 |
+
}
|
300 |
+
|
301 |
+
.model select{
|
302 |
+
background-color: #4BD28A;
|
303 |
+
|
304 |
+
}
|
305 |
+
|
306 |
+
|
307 |
+
.top-n{
|
308 |
+
height:50px;
|
309 |
+
background-color: #4BD28A;
|
310 |
+
width:140px;
|
311 |
+
display: flex;
|
312 |
+
justify-content: space-between;
|
313 |
+
font-size: 20px;
|
314 |
+
align-items: center;
|
315 |
+
padding-right: 10px;
|
316 |
+
padding-left: 10px;
|
317 |
+
border-radius: 5px;
|
318 |
+
|
319 |
+
}
|
320 |
+
.top-n:hover{
|
321 |
+
background-color: #0f8d17;
|
322 |
+
color: white;
|
323 |
+
transition: background-color 0.3s ease, color 0.3s ease;
|
324 |
+
}
|
325 |
+
|
326 |
+
.top-n select{
|
327 |
+
background-color: #4BD28A;
|
328 |
+
}
|
329 |
+
|
330 |
+
/* submission button */
|
331 |
+
.submit-btn button{
|
332 |
+
height: 50px;
|
333 |
+
width: 90px;
|
334 |
+
background-color: #4B64A3;
|
335 |
+
border-radius: 5px;
|
336 |
+
border: none;
|
337 |
+
}
|
338 |
+
|
339 |
+
.submit-btn button:hover {
|
340 |
+
background-color: #360d9f;
|
341 |
+
color: white;
|
342 |
+
transition: background-color 0.3s ease, color 0.3s ease;
|
343 |
+
}
|
344 |
+
|
345 |
+
|
346 |
+
.result-title{
|
347 |
+
background-color: #FFFFFF;
|
348 |
+
width: 80%;
|
349 |
+
height: 80px;
|
350 |
+
margin-top: 20px;
|
351 |
+
text-align: center;
|
352 |
+
font-size: 32px;
|
353 |
+
align-items: center;
|
354 |
+
animation: fadeInOut 5s infinite;
|
355 |
+
}
|
356 |
+
|
357 |
+
.result-title h2{
|
358 |
+
text-align: center;
|
359 |
+
margin-top: 10px;
|
360 |
+
|
361 |
+
}
|
362 |
+
|
363 |
+
.outcome{
|
364 |
+
width: 80%;
|
365 |
+
text-align: center;
|
366 |
+
background-color: #FFFFFF;
|
367 |
+
align-content: center;
|
368 |
+
margin-top: 22px;
|
369 |
+
height: 280px;
|
370 |
+
font-size: 24px;
|
371 |
+
text-align: center;
|
372 |
+
}
|
373 |
+
.outcome ul li{
|
374 |
+
list-style: none;
|
375 |
+
}
|
376 |
+
|
377 |
+
|
378 |
+
|
379 |
+
|
380 |
+
|
381 |
+
|
382 |
+
|
383 |
+
|
384 |
+
/* 3. COMPUTATIONS SECTION */
|
385 |
+
#computations {
|
386 |
+
background: linear-gradient(to top, #FFFFFF 0%, #D3D3D3 20%, #A9A9A9 50%, #D3D3D3 80%, #FFFFFF 100%, gray);
|
387 |
+
/*background-color: #3AA69D;*/
|
388 |
+
height: 850px;
|
389 |
+
position: relative;
|
390 |
+
width: 90.5%;
|
391 |
+
align-self: center;
|
392 |
+
margin-top: 100px;
|
393 |
+
display: flex;
|
394 |
+
flex-direction: column;
|
395 |
+
|
396 |
+
}
|
397 |
+
|
398 |
+
#computations h1{
|
399 |
+
position: absolute;
|
400 |
+
color:#FFFFFF;
|
401 |
+
font-family: "Kavoon";
|
402 |
+
top:100px;
|
403 |
+
left:180px;
|
404 |
+
font-size: 64px;
|
405 |
+
transition: transform 0.5s ease;
|
406 |
+
animation: fadeInOut 5s infinite;
|
407 |
+
}
|
408 |
+
|
409 |
+
#computations h1:hover {
|
410 |
+
transform: scale(1.1); /* Increase size by 10% */
|
411 |
+
color: #9c7a7a;
|
412 |
+
}
|
413 |
+
|
414 |
+
#embeddings img{
|
415 |
+
height: auto;
|
416 |
+
width:100%;
|
417 |
+
display: block;
|
418 |
+
align-self: center;
|
419 |
+
padding-top: 100px;
|
420 |
+
}
|
421 |
+
.result2{
|
422 |
+
display: flex;
|
423 |
+
flex-direction: column;
|
424 |
+
/* background-color: #0F296B; remove color */
|
425 |
+
background: linear-gradient(to bottom, #0F296B, black, #325452, #101a1a, rgb(176, 174, 174), white);
|
426 |
+
height: auto;
|
427 |
+
width: 40%;
|
428 |
+
margin-right: 60px;
|
429 |
+
align-items: center;
|
430 |
+
color:black;
|
431 |
+
margin-bottom: 25px;
|
432 |
+
|
433 |
+
}
|
434 |
+
|
435 |
+
|
436 |
+
|
437 |
+
|
438 |
+
|
439 |
+
|
440 |
+
/* 4. CONTACT SECTION */
|
441 |
+
#contact {
|
442 |
+
/* background-color: #F2ECDC; */
|
443 |
+
background: linear-gradient(to bottom,#8d8266,rgb(242, 239, 239), #F2ECDC, #F2ECDC, #8d8266, rgb(6, 6, 26));
|
444 |
+
height: 950px;
|
445 |
+
position: relative;
|
446 |
+
width: 90.5%;
|
447 |
+
align-self: center;
|
448 |
+
margin-top: 0;
|
449 |
+
display: flex;
|
450 |
+
flex-direction: column;
|
451 |
+
|
452 |
+
}
|
453 |
+
|
454 |
+
.personal-info{
|
455 |
+
display: flex;
|
456 |
+
margin-top: 150px;
|
457 |
+
margin-left: 70px;
|
458 |
+
margin-right: 80px;
|
459 |
+
height: 700px;
|
460 |
+
}
|
461 |
+
|
462 |
+
|
463 |
+
.daisy{
|
464 |
+
display: flex;
|
465 |
+
margin-bottom: 90px;
|
466 |
+
justify-content: space-between;
|
467 |
+
align-items: center;
|
468 |
+
}
|
469 |
+
.daisy img{
|
470 |
+
height: 250px;
|
471 |
+
width: 300px;
|
472 |
+
border-radius: 50%;
|
473 |
+
object-fit: cover;
|
474 |
+
}
|
475 |
+
.daisy-bio{
|
476 |
+
background-color: #72AE24;
|
477 |
+
width:400px;
|
478 |
+
height: 160px;
|
479 |
+
align-items: center;
|
480 |
+
text-align: center;
|
481 |
+
font-size: 20px;
|
482 |
+
font-family: 'Itim';
|
483 |
+
}
|
484 |
+
|
485 |
+
.ruva{
|
486 |
+
display: flex;
|
487 |
+
margin-bottom: 90px;
|
488 |
+
justify-content: space-between;
|
489 |
+
align-items: center;
|
490 |
+
}
|
491 |
+
.ruva img{
|
492 |
+
height: 250px;
|
493 |
+
width: 300px;
|
494 |
+
border-radius: 50%;
|
495 |
+
object-fit: cover;
|
496 |
+
}
|
497 |
+
.ruva-bio{
|
498 |
+
background-color: #EA8E39;
|
499 |
+
width:400px;
|
500 |
+
height: 160px;
|
501 |
+
margin-left: 30px;
|
502 |
+
text-align: center;
|
503 |
+
font-size: 20px;
|
504 |
+
font-family: 'Itim';
|
505 |
+
}
|
506 |
+
|
507 |
+
/* the form details*/
|
508 |
+
.form-container{
|
509 |
+
width: 400px;
|
510 |
+
height: 450px;
|
511 |
+
background-color: white;
|
512 |
+
margin-top: 45px;
|
513 |
+
display: flex;
|
514 |
+
flex-direction: column;
|
515 |
+
background-color: white;
|
516 |
+
padding: 20px 40px;
|
517 |
+
border-radius: 10px;
|
518 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
519 |
+
width: 100%;
|
520 |
+
max-width: 400px;
|
521 |
+
}
|
522 |
+
|
523 |
+
|
524 |
+
|
525 |
+
form h2 {
|
526 |
+
text-align: center;
|
527 |
+
margin-bottom: 10px;
|
528 |
+
font-family: 'Jacques Francois';
|
529 |
+
font-size: 50px;
|
530 |
+
margin-top: 5px;
|
531 |
+
}
|
532 |
+
form hr{
|
533 |
+
margin-bottom: 30px;
|
534 |
+
}
|
535 |
+
|
536 |
+
.form-group {
|
537 |
+
display: flex;
|
538 |
+
align-items: center;
|
539 |
+
margin-bottom: 20px;
|
540 |
+
}
|
541 |
+
|
542 |
+
.form-group label {
|
543 |
+
width: 100px;
|
544 |
+
margin-right: 10px;
|
545 |
+
}
|
546 |
+
|
547 |
+
.form-group input[type="text"],
|
548 |
+
.form-group input[type="email"],
|
549 |
+
.form-group textarea {
|
550 |
+
flex: 1;
|
551 |
+
padding: 10px;
|
552 |
+
border: 1px solid #ccc;
|
553 |
+
border-radius: 5px;
|
554 |
+
box-sizing: border-box;
|
555 |
+
background-color: #D9D9D9;
|
556 |
+
}
|
557 |
+
|
558 |
+
.checkbox-group {
|
559 |
+
display: block;
|
560 |
+
}
|
561 |
+
|
562 |
+
button {
|
563 |
+
width: 100%;
|
564 |
+
padding: 10px;
|
565 |
+
background-color: #EA8E39;
|
566 |
+
border: none;
|
567 |
+
color: white;
|
568 |
+
font-size: 16px;
|
569 |
+
border-radius: 5px;
|
570 |
+
cursor: pointer;
|
571 |
+
transition: background-color 0.3s ease;
|
572 |
+
}
|
573 |
+
|
574 |
+
button:hover {
|
575 |
+
background-color: #4cae4c;
|
576 |
+
}
|
577 |
+
|
578 |
+
|
579 |
+
footer {
|
580 |
+
/* background-color: black; */
|
581 |
+
background: linear-gradient(to bottom, rgb(19, 19, 41), rgb(6, 6, 26));
|
582 |
+
color: white;
|
583 |
+
padding: 20px 0;
|
584 |
+
text-align: center;
|
585 |
+
display: flex;
|
586 |
+
justify-content: space-between;
|
587 |
+
align-items: center;
|
588 |
+
|
589 |
+
}
|
590 |
+
footer p{
|
591 |
+
margin-left: 40px;
|
592 |
+
}
|
593 |
+
footer div{
|
594 |
+
margin-right: 50px;
|
595 |
+
|
596 |
+
}
|
597 |
+
.social-media-icons a {
|
598 |
+
color: white;
|
599 |
+
margin: 0 10px;
|
600 |
+
font-size: 24px;
|
601 |
+
text-decoration: none;
|
602 |
+
transition: color 0.3s ease;
|
603 |
+
}
|
604 |
+
.social-media-icons a:hover {
|
605 |
+
color: #007BFF; /* Change this color to whatever you prefer */
|
606 |
+
}
|
607 |
+
|
608 |
+
|
609 |
+
|
models_deploy/static/images/daisy.png
ADDED
Git LFS Details
|
models_deploy/static/images/logo.png
ADDED
models_deploy/static/images/nlp.png
ADDED
Git LFS Details
|
models_deploy/static/images/ruva.png
ADDED
models_deploy/static/images/welcome.png
ADDED
Git LFS Details
|
models_deploy/templates/index.html
ADDED
@@ -0,0 +1,377 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>zvirevo</title>
|
7 |
+
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
|
8 |
+
<link href="https://fonts.googleapis.com/css2?family=Jacques+Francois+Shadow&display=swap" rel="stylesheet">
|
9 |
+
<link href="https://fonts.googleapis.com/css2?family=Jacques+Francois&display=swap" rel="stylesheet">
|
10 |
+
<link href="https://fonts.googleapis.com/css2?family=Kavoon&display=swap" rel="stylesheet">
|
11 |
+
<link href="https://fonts.googleapis.com/css2?family=Itim&display=swap" rel="stylesheet">
|
12 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
13 |
+
|
14 |
+
|
15 |
+
</head>
|
16 |
+
|
17 |
+
<body>
|
18 |
+
|
19 |
+
|
20 |
+
<!-- 1. WELCOME SECTION-->
|
21 |
+
<section id="welcome" class="welcome">
|
22 |
+
<!-- header -->
|
23 |
+
<header>
|
24 |
+
<!-- navigation bar -->
|
25 |
+
<nav>
|
26 |
+
|
27 |
+
<!-- logo -->
|
28 |
+
<div class="logo">
|
29 |
+
<img src="{{ url_for('static', filename='images/logo.png') }}" alt="Example Image">
|
30 |
+
<!-- <img src="images/logo.png" alt=""> -->
|
31 |
+
<p>Zvirevo</p>
|
32 |
+
</div>
|
33 |
+
|
34 |
+
|
35 |
+
<!-- headings -->
|
36 |
+
<ul>
|
37 |
+
<li><a href="#welcome">About</a></li>
|
38 |
+
<li><a href="#embeddings">Embeddings</a></li>
|
39 |
+
<li><a href="#computations">Computations</a></li>
|
40 |
+
<li><a href="#contact">Contact</a></li>
|
41 |
+
</ul>
|
42 |
+
</nav>
|
43 |
+
<hr>
|
44 |
+
</header>
|
45 |
+
|
46 |
+
<!-- welcome message -->
|
47 |
+
<div class="welcomeMsg">
|
48 |
+
<img src="{{ url_for('static', filename='images/welcome.png') }}" alt="Example Image">
|
49 |
+
<!-- <img src="images/welcome.png" alt=""> -->
|
50 |
+
<div class="rectangle"></div>
|
51 |
+
<h1>Welcome to <span style="color:rgb(163, 46, 199)">Zvirevo</span></h1>
|
52 |
+
|
53 |
+
<div class="container">
|
54 |
+
<div class="ellipse"></div>
|
55 |
+
|
56 |
+
<div class="ellipse top">
|
57 |
+
<div class="text">Increasing accessibility and functionality of <span style="color:rgb(171, 10, 203)">AI</span> through enhancing NLP capabilities for agglutinitive <span style="color:rgb(171, 10, 203)">African languages</span> with complex morphologies.
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
|
62 |
+
</div>
|
63 |
+
|
64 |
+
|
65 |
+
|
66 |
+
</section>
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
|
73 |
+
<!-- 2. EMBEDDINGS SECTION-->
|
74 |
+
<section id="embeddings">
|
75 |
+
<h1>Perform Word <br><span style="color:rgb(163, 46, 199)">Embeddings</span></h1>
|
76 |
+
<img src="{{ url_for('static', filename='images/nlp.png') }}" alt="NLP Image">
|
77 |
+
|
78 |
+
<div class="generate">
|
79 |
+
<form id="embeddingForm" class="word">
|
80 |
+
<div class="word">
|
81 |
+
<div class="type-word">
|
82 |
+
<input type="text" id="wordInput" placeholder="Enter the word here e.g. mukadzi" required>
|
83 |
+
</div>
|
84 |
+
|
85 |
+
<div class="btns1">
|
86 |
+
<!-- Choose model -->
|
87 |
+
<div class="model">
|
88 |
+
<label for="modelSelect">Choose model</label>
|
89 |
+
<select id="modelSelect" name="modelSelect" required>
|
90 |
+
<!-- <option value="" disabled selected>Select a model</option> -->
|
91 |
+
<option value="word2vec">Word2Vec</option>
|
92 |
+
<option value="fasttext">FastText</option>
|
93 |
+
</select>
|
94 |
+
</div>
|
95 |
+
|
96 |
+
<!-- Select top words -->
|
97 |
+
<div class="top-n">
|
98 |
+
<label for="topNSelect">Top-n</label>
|
99 |
+
<select id="topNSelect" name="topNSelect" required>
|
100 |
+
<!-- <option value="" disabled selected>Select number of similar words</option> -->
|
101 |
+
<option value="1">1</option>
|
102 |
+
<option value="2">2</option>
|
103 |
+
<option value="3">3</option>
|
104 |
+
<option value="4">4</option>
|
105 |
+
<option value="5">5</option>
|
106 |
+
</select>
|
107 |
+
</div>
|
108 |
+
|
109 |
+
<!-- Submit -->
|
110 |
+
<div class="submit-btn">
|
111 |
+
<button type="submit">Submit</button>
|
112 |
+
</div>
|
113 |
+
</div>
|
114 |
+
</div>
|
115 |
+
</form>
|
116 |
+
|
117 |
+
<div class="result1">
|
118 |
+
<div class="result-title">
|
119 |
+
<h2>Results</h2>
|
120 |
+
</div>
|
121 |
+
|
122 |
+
<div class="outcome">
|
123 |
+
<ul id="resultsList">
|
124 |
+
<!-- Results will be dynamically inserted here -->
|
125 |
+
</ul>
|
126 |
+
</div>
|
127 |
+
</div>
|
128 |
+
</div>
|
129 |
+
</section>
|
130 |
+
|
131 |
+
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
|
136 |
+
|
137 |
+
|
138 |
+
<!-- 3. COMPUTATIONS SECTION-->
|
139 |
+
|
140 |
+
|
141 |
+
<section id="computations">
|
142 |
+
<h1>Perform Word <br><span style="color:rgb(163, 46, 199)">Computations</span></h1>
|
143 |
+
<img src="{{ url_for('static', filename='images/nlp.png') }}" alt="Example Image">
|
144 |
+
<!-- <img src="images/nlp.png" alt=""> -->
|
145 |
+
|
146 |
+
<div class="generate">
|
147 |
+
<form id="computationForm" class="word">
|
148 |
+
<div class="word">
|
149 |
+
<div class="type-word">
|
150 |
+
<input id="expressionInput" type="text" placeholder="Enter expression e.g. vana + vasikana - vakomana" required>
|
151 |
+
</div>
|
152 |
+
<div class="btns1">
|
153 |
+
<!-- Choose model -->
|
154 |
+
<div class="model">
|
155 |
+
<label for="modelSelectComputation">Choose model</label>
|
156 |
+
<select id="modelSelectComputation" name="modelSelectComputation" required>
|
157 |
+
<option value="word2vec">Word2Vec</option>
|
158 |
+
<option value="fasttext">FastText</option>
|
159 |
+
</select>
|
160 |
+
</div>
|
161 |
+
<!-- Select top words -->
|
162 |
+
<div class="top-n">
|
163 |
+
<label for="topNSelectComputation">Top-n</label>
|
164 |
+
<select id="topNSelectComputation" name="topNSelectComputation" required>
|
165 |
+
<option value="1">1</option>
|
166 |
+
<option value="2">2</option>
|
167 |
+
<option value="3">3</option>
|
168 |
+
<option value="4">4</option>
|
169 |
+
<option value="5">5</option>
|
170 |
+
</select>
|
171 |
+
</div>
|
172 |
+
<!-- Submit -->
|
173 |
+
<div class="submit-btn">
|
174 |
+
<button type="submit">Submit</button>
|
175 |
+
</div>
|
176 |
+
</div>
|
177 |
+
</div>
|
178 |
+
</form>
|
179 |
+
<div class="result2">
|
180 |
+
<div class="result-title">
|
181 |
+
<h2>Results</h2>
|
182 |
+
</div>
|
183 |
+
<div class="outcome">
|
184 |
+
<ul id="computationResultsList">
|
185 |
+
<!-- Results will be dynamically inserted here -->
|
186 |
+
</ul>
|
187 |
+
</div>
|
188 |
+
</div>
|
189 |
+
|
190 |
+
</div>
|
191 |
+
|
192 |
+
</section>
|
193 |
+
|
194 |
+
|
195 |
+
|
196 |
+
|
197 |
+
|
198 |
+
|
199 |
+
|
200 |
+
|
201 |
+
<!-- 4. CONTACT SECTION-->
|
202 |
+
<section id="contact">
|
203 |
+
|
204 |
+
<!-- personal details on collaborators-->
|
205 |
+
<div class="personal-info">
|
206 |
+
<div class="people">
|
207 |
+
<div class="daisy">
|
208 |
+
<img src="{{ url_for('static', filename='images/daisy.png') }}" alt="Example Image">
|
209 |
+
<!-- <img src="images/daisy.png" alt=""> -->
|
210 |
+
<div class="daisy-bio">
|
211 |
+
<p>Hello! <br>
|
212 |
+
"I'm Daisy, a passionate innovator in the tech world.
|
213 |
+
Creating this project has been an incredibly fulfilling journey for me."
|
214 |
+
</p>
|
215 |
+
</div>
|
216 |
+
|
217 |
+
</div>
|
218 |
+
|
219 |
+
<div class="ruva">
|
220 |
+
<img src="{{ url_for('static', filename='images/ruva.png') }}" alt="Example Image">
|
221 |
+
<!-- <img src="images/ruva.png" alt=""> -->
|
222 |
+
<div class="ruva-bio">
|
223 |
+
<p>
|
224 |
+
Hi there, <br> “I'm Ruva, a tech ethusiast.
|
225 |
+
Building this project was the most beautiful thing i have ever done in my life”
|
226 |
+
|
227 |
+
</p>
|
228 |
+
</div>
|
229 |
+
|
230 |
+
</div>
|
231 |
+
|
232 |
+
</div>
|
233 |
+
|
234 |
+
|
235 |
+
|
236 |
+
<hr>
|
237 |
+
|
238 |
+
|
239 |
+
|
240 |
+
<div class="form-container">
|
241 |
+
<form id="contactForm" action="/submit" method="POST">
|
242 |
+
<h2>Contact Us</h2>
|
243 |
+
<hr>
|
244 |
+
|
245 |
+
<div class="form-group">
|
246 |
+
<label for="name">Name:</label>
|
247 |
+
<input type="text" id="name" name="name" required>
|
248 |
+
</div>
|
249 |
+
|
250 |
+
<div class="form-group">
|
251 |
+
<label for="email">Email:</label>
|
252 |
+
<input type="email" id="email" name="email" required>
|
253 |
+
</div>
|
254 |
+
|
255 |
+
<div class="form-group">
|
256 |
+
<textarea id="message" name="message" rows="4" required placeholder="Type message ... "></textarea>
|
257 |
+
</div>
|
258 |
+
|
259 |
+
|
260 |
+
|
261 |
+
<div class="form-group checkbox-group">
|
262 |
+
<label>
|
263 |
+
<input type="checkbox" name="subscribe" checked> Subscribe to our newsletter
|
264 |
+
</label>
|
265 |
+
</div>
|
266 |
+
|
267 |
+
<button type="submit">Submit</button>
|
268 |
+
<div id="responseMessage"></div>
|
269 |
+
</form>
|
270 |
+
</div>
|
271 |
+
|
272 |
+
|
273 |
+
</div>
|
274 |
+
|
275 |
+
|
276 |
+
|
277 |
+
<footer>
|
278 |
+
<p>© zvirevo 2024</p>
|
279 |
+
<div class="social-media-icons">
|
280 |
+
<a href="https://www.facebook.com" target="_blank"><i class="fab fa-facebook-f"></i></a>
|
281 |
+
<a href="https://www.twitter.com" target="_blank"><i class="fab fa-twitter"></i></a>
|
282 |
+
<a href="https://www.instagram.com" target="_blank"><i class="fab fa-instagram"></i></a>
|
283 |
+
<a href="https://www.linkedin.com/in/daisy-tsenesa-577b5a221/" target="_blank"><i class="fab fa-linkedin-in"></i></a>
|
284 |
+
<a href="https://github.com/daisy-py-bot" target="_blank"><i class="fab fa-github"></i></a>
|
285 |
+
</div>
|
286 |
+
|
287 |
+
</footer>
|
288 |
+
</section>
|
289 |
+
|
290 |
+
</body>
|
291 |
+
|
292 |
+
<script>
|
293 |
+
// Get the form for the word embeddings
|
294 |
+
document.getElementById('embeddingForm').addEventListener('submit', function(e) {
|
295 |
+
e.preventDefault();
|
296 |
+
const word = document.getElementById('wordInput').value;
|
297 |
+
const modelType = document.getElementById('modelSelect').value;
|
298 |
+
const topN = document.getElementById('topNSelect').value;
|
299 |
+
|
300 |
+
fetch('/get_similar_words', {
|
301 |
+
method: 'POST',
|
302 |
+
headers: { 'Content-Type': 'application/json' },
|
303 |
+
body: JSON.stringify({ word: word, model_type: modelType, top_n: topN })
|
304 |
+
})
|
305 |
+
.then(response => response.json())
|
306 |
+
.then(data => {
|
307 |
+
const resultsList = document.getElementById('resultsList');
|
308 |
+
resultsList.innerHTML = ''; // Clear previous results
|
309 |
+
|
310 |
+
if (data.error) {
|
311 |
+
resultsList.innerHTML = `<li>Error: ${data.error}</li>`;
|
312 |
+
} else {
|
313 |
+
data.similar_words.forEach(item => {
|
314 |
+
const listItem = document.createElement('li');
|
315 |
+
listItem.textContent = `${item[0]}: ${item[1].toFixed(4)}`;
|
316 |
+
resultsList.appendChild(listItem);
|
317 |
+
});
|
318 |
+
}
|
319 |
+
})
|
320 |
+
.catch(error => console.error('Error:', error));
|
321 |
+
});
|
322 |
+
|
323 |
+
|
324 |
+
|
325 |
+
// Get the form from the word computations
|
326 |
+
document.getElementById('computationForm').addEventListener('submit', function(e) {
|
327 |
+
e.preventDefault();
|
328 |
+
const expression = document.getElementById('expressionInput').value;
|
329 |
+
const modelType = document.getElementById('modelSelectComputation').value;
|
330 |
+
const topN = document.getElementById('topNSelectComputation').value;
|
331 |
+
|
332 |
+
fetch('/compute', {
|
333 |
+
method: 'POST',
|
334 |
+
headers: { 'Content-Type': 'application/json' },
|
335 |
+
body: JSON.stringify({ expression: expression, model: modelType, top_n: topN })
|
336 |
+
})
|
337 |
+
.then(response => response.json())
|
338 |
+
.then(data => {
|
339 |
+
const computationResultsList = document.getElementById('computationResultsList');
|
340 |
+
computationResultsList.innerHTML = ''; // Clear previous results
|
341 |
+
|
342 |
+
if (data.error) {
|
343 |
+
computationResultsList.innerHTML = `<li>${data.error}</li>`;
|
344 |
+
} else {
|
345 |
+
data.forEach(item => {
|
346 |
+
const listItem = document.createElement('li');
|
347 |
+
listItem.textContent = `${item.word}: ${item.similarity.toFixed(4)}`;
|
348 |
+
computationResultsList.appendChild(listItem);
|
349 |
+
});
|
350 |
+
}
|
351 |
+
})
|
352 |
+
.catch(error => console.error('Error:', error));
|
353 |
+
});
|
354 |
+
|
355 |
+
|
356 |
+
// Send email
|
357 |
+
|
358 |
+
document.getElementById('contactForm').addEventListener('submit', function(event) {
|
359 |
+
event.preventDefault(); // Prevent the default form submission
|
360 |
+
|
361 |
+
const formData = new FormData(this);
|
362 |
+
fetch('/submit', {
|
363 |
+
method: 'POST',
|
364 |
+
body: formData
|
365 |
+
})
|
366 |
+
.then(response => response.json())
|
367 |
+
.then(data => {
|
368 |
+
document.getElementById('responseMessage').innerText = data.message;
|
369 |
+
})
|
370 |
+
.catch(error => {
|
371 |
+
console.error('Error:', error);
|
372 |
+
document.getElementById('responseMessage').innerText = 'An error occurred. Please try again.';
|
373 |
+
});
|
374 |
+
});
|
375 |
+
|
376 |
+
</script>
|
377 |
+
</html>
|
models_deploy/w2v_shona2.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7d0cb0a73c32c9e0fbfb5da4465fd34fce90a96c59dcbcbe6542283103429c9b
|
3 |
+
size 6431891
|
models_deploy/w2v_shona2.model.syn1neg.npy
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8b902176be33ab4d264d4694adf532e12a73eaa749d77fe5dacfd2fa1cfd9905
|
3 |
+
size 229160528
|
models_deploy/w2v_shona2.model.wv.vectors.npy
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3d78b4cba8648bc21b9c787d62c3e60b322bd66746d4b5d84ab351bed473a944
|
3 |
+
size 229160528
|