Spaces:
Running
Running
eljanmahammadli
commited on
Commit
•
d4ada6d
1
Parent(s):
d815872
added rounding to the similarity
Browse files- __pycache__/utils.cpython-310.pyc +0 -0
- __pycache__/utils.cpython-311.pyc +0 -0
- __pycache__/writing_analysis.cpython-310.pyc +0 -0
- app.py +2 -2
- utils.py +1 -1
__pycache__/utils.cpython-310.pyc
DELETED
Binary file (7.22 kB)
|
|
__pycache__/utils.cpython-311.pyc
DELETED
Binary file (13.7 kB)
|
|
__pycache__/writing_analysis.cpython-310.pyc
DELETED
Binary file (4.6 kB)
|
|
app.py
CHANGED
@@ -159,7 +159,7 @@ def plagiarism_check(
|
|
159 |
for ind in index:
|
160 |
formatted_tokens.append(
|
161 |
(
|
162 |
-
urlList[ind] + " --- Matching Score: " + str(urlScore[ind]),
|
163 |
"[" + str(urlMap[ind]) + "]",
|
164 |
)
|
165 |
)
|
@@ -273,7 +273,7 @@ def build_date(year, month, day):
|
|
273 |
return f"{year}{months[month]}{day}"
|
274 |
|
275 |
def len_validator(text):
|
276 |
-
min_chars =
|
277 |
if len(text) < min_chars:
|
278 |
return f"Warning! Input length is {len(text)}. Please input a text that is greater than {min_chars} characters long. Recommended length {min_chars*2} characters."
|
279 |
else :
|
|
|
159 |
for ind in index:
|
160 |
formatted_tokens.append(
|
161 |
(
|
162 |
+
urlList[ind] + " --- Matching Score: " + f"{str(round(urlScore[ind] * 100, 2))}%",
|
163 |
"[" + str(urlMap[ind]) + "]",
|
164 |
)
|
165 |
)
|
|
|
273 |
return f"{year}{months[month]}{day}"
|
274 |
|
275 |
def len_validator(text):
|
276 |
+
min_chars = 350
|
277 |
if len(text) < min_chars:
|
278 |
return f"Warning! Input length is {len(text)}. Please input a text that is greater than {min_chars} characters long. Recommended length {min_chars*2} characters."
|
279 |
else :
|
utils.py
CHANGED
@@ -60,7 +60,7 @@ def sentence_similarity(text1, text2):
|
|
60 |
embedding_2 = model.encode(text2, convert_to_tensor=True)
|
61 |
|
62 |
o = util.pytorch_cos_sim(embedding_1, embedding_2)
|
63 |
-
return
|
64 |
|
65 |
def get_soup_requests(url):
|
66 |
page = requests.get(url)
|
|
|
60 |
embedding_2 = model.encode(text2, convert_to_tensor=True)
|
61 |
|
62 |
o = util.pytorch_cos_sim(embedding_1, embedding_2)
|
63 |
+
return o.item()
|
64 |
|
65 |
def get_soup_requests(url):
|
66 |
page = requests.get(url)
|