Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
middleware-automatic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenjunjie
middleware-automatic
Commits
c8fd22a4
Commit
c8fd22a4
authored
May 09, 2023
by
liuyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release' into 'master'
Release See merge request
!19
parents
a41e52e9
1c584bf9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
middleware-automatic-center-son/src/main/java/com/zhiwei/middleware/automatic/son/task/service/TaskServiceCommon.java
+4
-4
middleware-automatic-center-son/src/main/java/com/zhiwei/middleware/automatic/son/util/CosineSimilarity.java
+7
-5
No files found.
middleware-automatic-center-son/src/main/java/com/zhiwei/middleware/automatic/son/task/service/TaskServiceCommon.java
View file @
c8fd22a4
...
...
@@ -196,13 +196,13 @@ public class TaskServiceCommon extends BaseTaskTypePair<TaskServiceCommon.TaskCo
Map
<
String
,
Object
>
similarMap
=
similarMapInfo
(
titleVoMap
,
title
,
group
);
if
(!
similarMap
.
isEmpty
())
{
// 填充数据
String
aggreTitle
=
String
.
valueOf
(
similarMap
.
get
(
"aggreTitle"
));
String
aggreTitle
=
String
.
valueOf
(
similarMap
.
get
(
"aggre
e
Title"
));
TemplateTitleVo
templateTitleVo
=
titleVoMap
.
get
(
aggreTitle
);
String
aggreTag
=
templateTitleVo
.
getMtag
();
sourceObj
.
put
(
GenericAttribute
.
ES_M_TAG
,
aggreTag
);
String
aggre
e
Tag
=
templateTitleVo
.
getMtag
();
sourceObj
.
put
(
GenericAttribute
.
ES_M_TAG
,
aggre
e
Tag
);
sourceObj
.
put
(
GenericAttribute
.
ES_M_PERSON
,
"自动化机器人"
);
sourceObj
.
put
(
GenericAttribute
.
ES_M_TIME
,
new
Date
().
getTime
());
log
.
info
(
"项目:{} 模板标题:{} MarkSum:{} Tag:{}被标注标题:{}相似度:{}"
,
group
,
aggreTitle
,
templateTitleVo
.
getMarkSum
(),
aggreTag
,
log
.
info
(
"项目:{} 模板标题:{} MarkSum:{} Tag:{}被标注标题:{}相似度:{}"
,
group
,
aggreTitle
,
templateTitleVo
.
getMarkSum
(),
aggre
e
Tag
,
title
,
similarMap
.
get
(
"similar"
));
// 刷新一下标注量和标注时间,
...
...
middleware-automatic-center-son/src/main/java/com/zhiwei/middleware/automatic/son/util/CosineSimilarity.java
View file @
c8fd22a4
package
com
.
zhiwei
.
middleware
.
automatic
.
son
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.Resource
;
import
java.io.*
;
import
java.util.*
;
...
...
@@ -9,20 +11,20 @@ public class CosineSimilarity {
private
static
final
List
<
String
>
BRAND_WORDS
=
new
ArrayList
<>();
private
static
final
String
path
=
"
classpath:
static/brandWords.json"
;
private
static
final
String
path
=
"static/brandWords.json"
;
static
{
try
{
InputStream
inputStream
=
new
FileInputStream
(
path
);
String
jsonStr
=
readJsonFile
(
inputStream
);
Resource
resource
=
new
ClassPathResource
(
path
);
String
jsonStr
=
readJsonFile
(
resource
.
getInputStream
()
);
if
(
null
!=
jsonStr
)
{
List
<
List
>
array
=
JSONObject
.
parseArray
(
jsonStr
,
List
.
class
);
for
(
List
str
:
array
)
{
BRAND_WORDS
.
addAll
(
str
);
}
}
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
Exception
x
)
{
x
.
printStackTrace
();
}
}
...
...
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