Adding the result side legend
Browse files- FrModel.py +1 -1
- __pycache__/FrModel.cpython-310.pyc +0 -0
- __pycache__/helper_functions.cpython-310.pyc +0 -0
- helper_functions.py +1 -1
- static/js/pdf.js +2 -2
- static/js/pdf_fr.js +1 -1
- templates/voice.html +1 -1
- templates/voice_backup.html +1 -1
- templates/voice_fr.html +1 -1
FrModel.py
CHANGED
@@ -47,7 +47,7 @@ class Embedding(nn.Module):
|
|
47 |
pos = pos.unsqueeze(0).expand_as(x) # (seq_len,) -> (batch_size, seq_len)
|
48 |
embedding = self.tok_embed(x)
|
49 |
embedding += self.pos_embed(pos)
|
50 |
-
embedding += self.seg_embed(seg)
|
51 |
return self.norm(embedding)
|
52 |
|
53 |
class ScaledDotProductAttention(nn.Module):
|
|
|
47 |
pos = pos.unsqueeze(0).expand_as(x) # (seq_len,) -> (batch_size, seq_len)
|
48 |
embedding = self.tok_embed(x)
|
49 |
embedding += self.pos_embed(pos)
|
50 |
+
embedding += self.seg_embed(seg)
|
51 |
return self.norm(embedding)
|
52 |
|
53 |
class ScaledDotProductAttention(nn.Module):
|
__pycache__/FrModel.cpython-310.pyc
CHANGED
Binary files a/__pycache__/FrModel.cpython-310.pyc and b/__pycache__/FrModel.cpython-310.pyc differ
|
|
__pycache__/helper_functions.cpython-310.pyc
CHANGED
Binary files a/__pycache__/helper_functions.cpython-310.pyc and b/__pycache__/helper_functions.cpython-310.pyc differ
|
|
helper_functions.py
CHANGED
@@ -55,7 +55,7 @@ def load_fr_models():
|
|
55 |
print("Loading Wav2Vec2 model for French...")
|
56 |
wav2vec2_processor = Wav2Vec2Processor.from_pretrained("bhuang/asr-wav2vec2-french")
|
57 |
wav2vec2_model = AutoModelForCTC.from_pretrained("bhuang/asr-wav2vec2-french").to(device)
|
58 |
-
return fr_model, fr_neptune, wav2vec2_processor, wav2vec2_model
|
59 |
|
60 |
fr_class_labels = {0: ('Physics', 'primary', '#5e7cc8'), 1: ('AI','cyan', '#0dcaf0'),
|
61 |
2: ('economies', 'warning' , '#f7c32e'), 3: ('environments','success' , '#0cbc87'),
|
|
|
55 |
print("Loading Wav2Vec2 model for French...")
|
56 |
wav2vec2_processor = Wav2Vec2Processor.from_pretrained("bhuang/asr-wav2vec2-french")
|
57 |
wav2vec2_model = AutoModelForCTC.from_pretrained("bhuang/asr-wav2vec2-french").to(device)
|
58 |
+
return fr_model, fr_neptune, wav2vec2_processor, wav2vec2_model
|
59 |
|
60 |
fr_class_labels = {0: ('Physics', 'primary', '#5e7cc8'), 1: ('AI','cyan', '#0dcaf0'),
|
61 |
2: ('economies', 'warning' , '#f7c32e'), 3: ('environments','success' , '#0cbc87'),
|
static/js/pdf.js
CHANGED
@@ -8,8 +8,8 @@ const reset = document.getElementById("reset");
|
|
8 |
const imagePreview = dropArea.querySelector("#image-preview");
|
9 |
const currentClassProbabilitiesList = document.getElementById("class-probabilities");
|
10 |
const currentClassProbabilitiesList_resultSection = document.getElementById("class-probabilities-result-section");
|
11 |
-
const currentPredictedClass = document.getElementById('predicted-class')
|
12 |
-
const currentPredictedClass_resultSection = document.getElementById('predicted-class-result-section')
|
13 |
const sentencePredictions = document.getElementById('classifiedText')
|
14 |
const staticDiv = document.getElementById("static");
|
15 |
const dynamicDiv = document.getElementById("dynamic");
|
|
|
8 |
const imagePreview = dropArea.querySelector("#image-preview");
|
9 |
const currentClassProbabilitiesList = document.getElementById("class-probabilities");
|
10 |
const currentClassProbabilitiesList_resultSection = document.getElementById("class-probabilities-result-section");
|
11 |
+
const currentPredictedClass = document.getElementById('predicted-class');
|
12 |
+
const currentPredictedClass_resultSection = document.getElementById('predicted-class-result-section');
|
13 |
const sentencePredictions = document.getElementById('classifiedText')
|
14 |
const staticDiv = document.getElementById("static");
|
15 |
const dynamicDiv = document.getElementById("dynamic");
|
static/js/pdf_fr.js
CHANGED
@@ -3,7 +3,7 @@ const dragText = dropArea.querySelector("h6");
|
|
3 |
const input = dropArea.querySelector("input");
|
4 |
const form = document.querySelector("form");
|
5 |
const ocrResult = document.getElementById("ocr-result");
|
6 |
-
const categoryResult = document.getElementById("category-result")
|
7 |
const reset = document.getElementById("reset");
|
8 |
const imagePreview = dropArea.querySelector("#image-preview");
|
9 |
const currentClassProbabilitiesList = document.getElementById("class-probabilities");
|
|
|
3 |
const input = dropArea.querySelector("input");
|
4 |
const form = document.querySelector("form");
|
5 |
const ocrResult = document.getElementById("ocr-result");
|
6 |
+
const categoryResult = document.getElementById("category-result");
|
7 |
const reset = document.getElementById("reset");
|
8 |
const imagePreview = dropArea.querySelector("#image-preview");
|
9 |
const currentClassProbabilitiesList = document.getElementById("class-probabilities");
|
templates/voice.html
CHANGED
@@ -88,7 +88,7 @@
|
|
88 |
</div>
|
89 |
</div>
|
90 |
</div>
|
91 |
-
</div>
|
92 |
<h1 class="text-center text-white-50"> Results</h1>
|
93 |
<div class="card" id = 'static' style="background-color: #303131; border: 2px dashed rgb(82, 82, 82);">
|
94 |
<div class="card-body text-center" id="static">
|
|
|
88 |
</div>
|
89 |
</div>
|
90 |
</div>
|
91 |
+
</div>
|
92 |
<h1 class="text-center text-white-50"> Results</h1>
|
93 |
<div class="card" id = 'static' style="background-color: #303131; border: 2px dashed rgb(82, 82, 82);">
|
94 |
<div class="card-body text-center" id="static">
|
templates/voice_backup.html
CHANGED
@@ -191,7 +191,7 @@
|
|
191 |
</div>
|
192 |
|
193 |
</div>
|
194 |
-
</div>
|
195 |
</div>
|
196 |
</div>
|
197 |
</div>
|
|
|
191 |
</div>
|
192 |
|
193 |
</div>
|
194 |
+
</div>
|
195 |
</div>
|
196 |
</div>
|
197 |
</div>
|
templates/voice_fr.html
CHANGED
@@ -192,7 +192,7 @@
|
|
192 |
</div>
|
193 |
</div>
|
194 |
</div>
|
195 |
-
</div>
|
196 |
</div>
|
197 |
</div>
|
198 |
|
|
|
192 |
</div>
|
193 |
</div>
|
194 |
</div>
|
195 |
+
</div>
|
196 |
</div>
|
197 |
</div>
|
198 |
|