Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Noah Brackenbury
erp5
Commits
51f2b8c1
Commit
51f2b8c1
authored
Sep 07, 2017
by
Noah Brackenbury
Browse files
Options
Browse Files
Download
Plain Diff
merging
parents
e368e2d5
2e83d650
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
1 deletion
+21
-1
bt5/erp5_ai_business_bot/ExtensionTemplateItem/portal_components/extension.erp5.ParseWebMessage.py
...eItem/portal_components/extension.erp5.ParseWebMessage.py
+3
-0
bt5/erp5_ai_business_bot/ExtensionTemplateItem/portal_components/extension.erp5.SetWebMessageModel.py
...em/portal_components/extension.erp5.SetWebMessageModel.py
+3
-0
bt5/erp5_ai_business_bot/ExtensionTemplateItem/portal_components/extension.erp5.TestWebMessageModel.py
...m/portal_components/extension.erp5.TestWebMessageModel.py
+10
-0
bt5/erp5_ai_business_bot/bt/dependency_list
bt5/erp5_ai_business_bot/bt/dependency_list
+5
-1
No files found.
bt5/erp5_ai_business_bot/ExtensionTemplateItem/portal_components/extension.erp5.ParseWebMessage.py
View file @
51f2b8c1
...
@@ -40,8 +40,11 @@ def WebMessage_parseWebMessage(self):
...
@@ -40,8 +40,11 @@ def WebMessage_parseWebMessage(self):
reference
=
'ai_business_bot'
,
reference
=
'ai_business_bot'
,
title
=
"AI Business Bot"
)
title
=
"AI Business Bot"
)
erp5_file
=
portal
.
portal_catalog
.
getResultValue
(
**
kw
)
erp5_file
=
portal
.
portal_catalog
.
getResultValue
(
**
kw
)
<<<<<<<
HEAD
if
not
erp5_file
:
if
not
erp5_file
:
return
"No model found to be applied to this Web Message. Run Set Web Message Model in Event Module first."
return
"No model found to be applied to this Web Message. Run Set Web Message Model in Event Module first."
=======
>>>>>>>
2e83
d650106eb861a0c38350ab16aa6d13caea36
model_as_string
=
erp5_file
.
getData
()
model_as_string
=
erp5_file
.
getData
()
model
=
pickle
.
loads
(
model_as_string
)
model
=
pickle
.
loads
(
model_as_string
)
language_arrays
=
model
[
0
]
language_arrays
=
model
[
0
]
...
...
bt5/erp5_ai_business_bot/ExtensionTemplateItem/portal_components/extension.erp5.SetWebMessageModel.py
View file @
51f2b8c1
...
@@ -27,8 +27,11 @@ def WebMessage_setModel(self):
...
@@ -27,8 +27,11 @@ def WebMessage_setModel(self):
portal_type
=
"Web Message"
,
portal_type
=
"Web Message"
,
query
=
NegatedQuery
(
Query
(
subject
=
None
)),
query
=
NegatedQuery
(
Query
(
subject
=
None
)),
)
)
<<<<<<<
HEAD
if
not
training_messages
:
if
not
training_messages
:
return
"No Web Messages to train on"
return
"No Web Messages to train on"
=======
>>>>>>>
2e83
d650106eb861a0c38350ab16aa6d13caea36
for
message
in
training_messages
:
for
message
in
training_messages
:
(
language_arrays
,
tag_arrays
)
=
message
.
WebMessage_trainOnWebMessage
(
language_arrays
,
tag_arrays
,
stopwords_arrays
)
(
language_arrays
,
tag_arrays
)
=
message
.
WebMessage_trainOnWebMessage
(
language_arrays
,
tag_arrays
,
stopwords_arrays
)
end_time
=
time
.
time
()
end_time
=
time
.
time
()
...
...
bt5/erp5_ai_business_bot/ExtensionTemplateItem/portal_components/extension.erp5.TestWebMessageModel.py
View file @
51f2b8c1
...
@@ -27,8 +27,11 @@ def WebMessage_testModel(self):
...
@@ -27,8 +27,11 @@ def WebMessage_testModel(self):
portal_type
=
"Web Message"
,
portal_type
=
"Web Message"
,
query
=
NegatedQuery
(
Query
(
subject
=
None
)),
query
=
NegatedQuery
(
Query
(
subject
=
None
)),
)
)
<<<<<<<
HEAD
if
not
training_messages
:
if
not
training_messages
:
return
"No Web Messages found to train on"
return
"No Web Messages found to train on"
=======
>>>>>>>
2e83
d650106eb861a0c38350ab16aa6d13caea36
for
index
,
message
in
enumerate
(
training_messages
):
for
index
,
message
in
enumerate
(
training_messages
):
if
random
.
random
()
<=
0.2
:
if
random
.
random
()
<=
0.2
:
test_messages
.
append
(
message
)
test_messages
.
append
(
message
)
...
@@ -116,11 +119,18 @@ def WebMessage_testModel(self):
...
@@ -116,11 +119,18 @@ def WebMessage_testModel(self):
if
not
suggested_tags_set
.
intersection
(
sr
)
and
not
suggested_tags_set
.
intersection
(
so
):
if
not
suggested_tags_set
.
intersection
(
sr
)
and
not
suggested_tags_set
.
intersection
(
so
):
type_accuracy
+=
1
type_accuracy
+=
1
<<<<<<<
HEAD
if
not
len
(
test_messages
)
==
0
:
if
not
len
(
test_messages
)
==
0
:
correct_tags
=
float
(
correct_tags
)
/
float
(
len
(
test_messages
))
correct_tags
=
float
(
correct_tags
)
/
float
(
len
(
test_messages
))
excess_tags
=
float
(
excess_tags
)
/
float
(
len
(
test_messages
))
excess_tags
=
float
(
excess_tags
)
/
float
(
len
(
test_messages
))
language_accuracy
=
float
(
language_accuracy
)
/
float
(
len
(
test_messages
))
language_accuracy
=
float
(
language_accuracy
)
/
float
(
len
(
test_messages
))
type_accuracy
=
float
(
type_accuracy
)
/
float
(
len
(
test_messages
))
type_accuracy
=
float
(
type_accuracy
)
/
float
(
len
(
test_messages
))
=======
correct_tags
=
float
(
correct_tags
)
/
float
(
len
(
test_messages
))
excess_tags
=
float
(
excess_tags
)
/
float
(
len
(
test_messages
))
language_accuracy
=
float
(
language_accuracy
)
/
float
(
len
(
test_messages
))
type_accuracy
=
float
(
type_accuracy
)
/
float
(
len
(
test_messages
))
>>>>>>>
2e83
d650106eb861a0c38350ab16aa6d13caea36
end_time
=
time
.
time
()
end_time
=
time
.
time
()
uptime
=
end_time
-
start_time
uptime
=
end_time
-
start_time
human_uptime
=
str
(
datetime
.
timedelta
(
seconds
=
int
(
uptime
)))
human_uptime
=
str
(
datetime
.
timedelta
(
seconds
=
int
(
uptime
)))
...
...
bt5/erp5_ai_business_bot/bt/dependency_list
View file @
51f2b8c1
erp5_base
erp5_base
erp5_web
erp5_web
erp5_dms
erp5_dms
<<<<<<< HEAD
erp5_crm
erp5_crm
erp5_ingestion_mysql_innodb_catalog
erp5_ingestion_mysql_innodb_catalog
=======
erp5_crm
>>>>>>> 2e83d650106eb861a0c38350ab16aa6d13caea36
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment