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
d215ad7a
Commit
d215ad7a
authored
1 year ago
by
Tiravy Amaury
Browse files
Options
Downloads
Patches
Plain Diff
optimisations
parent
78bee6ac
No related branches found
No related tags found
1 merge request
!6
Test amau
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
chatbot_complet.py
+10
-10
10 additions, 10 deletions
chatbot_complet.py
reglementdescolarite-ingegeneraliste2324-1.docx.txt
+2
-2
2 additions, 2 deletions
reglementdescolarite-ingegeneraliste2324-1.docx.txt
with
12 additions
and
12 deletions
chatbot_complet.py
+
10
−
10
View file @
d215ad7a
...
...
@@ -175,8 +175,8 @@ class ChatbotInterface(QWidget):
user_command
=
self
.
user_input_entry
.
text
()
if
len
(
user_command
)
>
0
:
self
.
conversation_text
.
clear
()
self
.
conversation_text
.
append
(
f
"
Com
mande
utilisateur
:
{
user_command
}
"
)
self
.
conversation_text
.
append
(
"
Réponse du chatbot pour la
com
mande:
"
)
self
.
conversation_text
.
append
(
f
"
de
mande
élève
:
{
user_command
}
"
)
self
.
conversation_text
.
append
(
"
Réponse du chatbot pour la
de
mande:
"
)
best_answers
=
get_best_answers
(
user_command
,
self
.
text_lines
,
self
.
vectorizer
,
self
.
vectorial_base
)
chatbot_response
=
""
...
...
@@ -209,23 +209,23 @@ class ChatbotInterface(QWidget):
selected_index
=
self
.
history_list_widget
.
row
(
item
)
if
selected_index
<
len
(
self
.
command_history
):
selected_command
=
self
.
command_history
[
selected_index
]
self
.
conversation_text
.
append
(
f
"
Com
mande
utilisateur
:
{
self
.
dico2
[
selected_command
]
}
"
)
self
.
conversation_text
.
append
(
f
"
de
mande
élève
:
{
self
.
dico2
[
selected_command
]
}
"
)
# Traiter la commande et obtenir la réponse du chatbot (vous devrez ajuster cela en fonction de votre application)
chatbot_response
=
f
"
Réponse du chatbot pour la
com
mande:
\n
{
self
.
dico
[
selected_command
]
}
"
chatbot_response
=
f
"
Réponse du chatbot pour la
de
mande:
\n
{
self
.
dico
[
selected_command
]
}
"
self
.
conversation_text
.
append
(
chatbot_response
)
if
__name__
==
'
__main__
'
:
app
=
QApplication
(
sys
.
argv
)
chatbot_app
=
ChatbotInterface
()
# Centrer la fenêtre
screen
=
app
.
primaryScreen
()
center_point
=
screen
.
availableGeometry
().
center
()
chatbot_app
.
move
(
center_point
-
chatbot_app
.
rect
().
center
())
# Ajuster la taille de la fenêtre
new_width
=
screen
.
availableGeometry
().
width
()
//
2
chatbot_app
.
resize
(
new_width
,
screen
.
availableGeometry
().
height
()
*
7
/
8
)
chatbot_app
.
resize
(
new_width
,
int
(
screen
.
availableGeometry
().
height
()
*
15
/
16
))
# Centrer la fenêtre
center_point
=
screen
.
availableGeometry
().
center
().
x
()
-
chatbot_app
.
rect
().
center
().
x
()
chatbot_app
.
move
(
center_point
,
0
)
chatbot_app
.
show
()
sys
.
exit
(
app
.
exec_
())
\ No newline at end of file
This diff is collapsed.
Click to expand it.
reglementdescolarite-ingegeneraliste2324-1.docx.txt
+
2
−
2
View file @
d215ad7a
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