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
1c584bf9
Commit
1c584bf9
authored
May 09, 2023
by
liuyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature' into 'release'
2023年05/09 自动标注bug修复 See merge request
!17
parents
fc886662
28045e38
Hide 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 @
1c584bf9
...
@@ -196,13 +196,13 @@ public class TaskServiceCommon extends BaseTaskTypePair<TaskServiceCommon.TaskCo
...
@@ -196,13 +196,13 @@ public class TaskServiceCommon extends BaseTaskTypePair<TaskServiceCommon.TaskCo
Map
<
String
,
Object
>
similarMap
=
similarMapInfo
(
titleVoMap
,
title
,
group
);
Map
<
String
,
Object
>
similarMap
=
similarMapInfo
(
titleVoMap
,
title
,
group
);
if
(!
similarMap
.
isEmpty
())
{
if
(!
similarMap
.
isEmpty
())
{
// 填充数据
// 填充数据
String
aggreTitle
=
String
.
valueOf
(
similarMap
.
get
(
"aggreTitle"
));
String
aggreTitle
=
String
.
valueOf
(
similarMap
.
get
(
"aggre
e
Title"
));
TemplateTitleVo
templateTitleVo
=
titleVoMap
.
get
(
aggreTitle
);
TemplateTitleVo
templateTitleVo
=
titleVoMap
.
get
(
aggreTitle
);
String
aggreTag
=
templateTitleVo
.
getMtag
();
String
aggre
e
Tag
=
templateTitleVo
.
getMtag
();
sourceObj
.
put
(
GenericAttribute
.
ES_M_TAG
,
aggreTag
);
sourceObj
.
put
(
GenericAttribute
.
ES_M_TAG
,
aggre
e
Tag
);
sourceObj
.
put
(
GenericAttribute
.
ES_M_PERSON
,
"自动化机器人"
);
sourceObj
.
put
(
GenericAttribute
.
ES_M_PERSON
,
"自动化机器人"
);
sourceObj
.
put
(
GenericAttribute
.
ES_M_TIME
,
new
Date
().
getTime
());
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"
));
title
,
similarMap
.
get
(
"similar"
));
// 刷新一下标注量和标注时间,
// 刷新一下标注量和标注时间,
...
...
middleware-automatic-center-son/src/main/java/com/zhiwei/middleware/automatic/son/util/CosineSimilarity.java
View file @
1c584bf9
package
com
.
zhiwei
.
middleware
.
automatic
.
son
.
util
;
package
com
.
zhiwei
.
middleware
.
automatic
.
son
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.Resource
;
import
java.io.*
;
import
java.io.*
;
import
java.util.*
;
import
java.util.*
;
...
@@ -9,20 +11,20 @@ public class CosineSimilarity {
...
@@ -9,20 +11,20 @@ public class CosineSimilarity {
private
static
final
List
<
String
>
BRAND_WORDS
=
new
ArrayList
<>();
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
{
static
{
try
{
try
{
InputStream
inputStream
=
new
FileInputStream
(
path
);
Resource
resource
=
new
ClassPathResource
(
path
);
String
jsonStr
=
readJsonFile
(
inputStream
);
String
jsonStr
=
readJsonFile
(
resource
.
getInputStream
()
);
if
(
null
!=
jsonStr
)
{
if
(
null
!=
jsonStr
)
{
List
<
List
>
array
=
JSONObject
.
parseArray
(
jsonStr
,
List
.
class
);
List
<
List
>
array
=
JSONObject
.
parseArray
(
jsonStr
,
List
.
class
);
for
(
List
str
:
array
)
{
for
(
List
str
:
array
)
{
BRAND_WORDS
.
addAll
(
str
);
BRAND_WORDS
.
addAll
(
str
);
}
}
}
}
}
catch
(
FileNotFoundException
e
)
{
}
catch
(
Exception
x
)
{
e
.
printStackTrace
();
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