Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chatbot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
option3a
chatbot
Commits
164ce55b
Commit
164ce55b
authored
Mar 7, 2024
by
Tiravy Amaury
Browse files
Options
Downloads
Patches
Plain Diff
enlever_accents
parent
7427b81c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
requirements.txt
+2
-1
2 additions, 1 deletion
requirements.txt
test_combine.py
+3
-1
3 additions, 1 deletion
test_combine.py
with
5 additions
and
2 deletions
requirements.txt
+
2
−
1
View file @
164ce55b
...
@@ -12,3 +12,4 @@ PyQt5
...
@@ -12,3 +12,4 @@ PyQt5
sklearn
sklearn
nltk
nltk
sys
sys
unidecode
\ No newline at end of file
This diff is collapsed.
Click to expand it.
test_combine.py
+
3
−
1
View file @
164ce55b
...
@@ -7,6 +7,7 @@ from sklearn.metrics.pairwise import cosine_similarity
...
@@ -7,6 +7,7 @@ from sklearn.metrics.pairwise import cosine_similarity
import
numpy
as
np
import
numpy
as
np
from
nltk.corpus
import
stopwords
from
nltk.corpus
import
stopwords
from
nltk.tokenize
import
word_tokenize
from
nltk.tokenize
import
word_tokenize
from
unidecode
import
unidecode
def
read_text_file
(
file_path
):
def
read_text_file
(
file_path
):
"""
"""
...
@@ -18,7 +19,7 @@ def read_text_file(file_path):
...
@@ -18,7 +19,7 @@ def read_text_file(file_path):
"""
"""
with
open
(
file_path
,
'
r
'
,
encoding
=
'
utf-8
'
)
as
file
:
with
open
(
file_path
,
'
r
'
,
encoding
=
'
utf-8
'
)
as
file
:
content
=
file
.
read
().
split
(
'
\n\n
'
)
content
=
file
.
read
().
split
(
'
\n\n
'
)
content1
=
[
item
for
item
in
content
if
item
!=
""
]
content1
=
[
unidecode
(
item
)
for
item
in
content
if
item
!=
""
]
return
content1
return
content1
def
extract_keywords_french
(
sentence
):
def
extract_keywords_french
(
sentence
):
...
@@ -251,6 +252,7 @@ class ChatbotInterface(QWidget):
...
@@ -251,6 +252,7 @@ class ChatbotInterface(QWidget):
Handles the user
'
s input, processes it, and displays the chatbot
'
s response.
Handles the user
'
s input, processes it, and displays the chatbot
'
s response.
"""
"""
user_command
=
self
.
user_input_entry
.
text
()
user_command
=
self
.
user_input_entry
.
text
()
user_command
=
unidecode
(
user_command
)
if
len
(
user_command
)
>
0
:
if
len
(
user_command
)
>
0
:
self
.
conversation_text
.
clear
()
self
.
conversation_text
.
clear
()
self
.
conversation_text
.
append
(
f
"
demande élève:
{
user_command
}
"
)
self
.
conversation_text
.
append
(
f
"
demande élève:
{
user_command
}
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment