Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
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
brandkbs2
Commits
fd55f1af
Commit
fd55f1af
authored
Sep 09, 2024
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature' into 'release'
Feature See merge request
!586
parents
0f5f760e
64f6f90d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/impl/ToolsetServiceImpl.java
+9
-4
No files found.
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
fd55f1af
...
@@ -4076,7 +4076,7 @@ public class MarkDataServiceImpl implements MarkDataService {
...
@@ -4076,7 +4076,7 @@ public class MarkDataServiceImpl implements MarkDataService {
project
.
getContendList
().
forEach
(
contend
->
brandStr
.
append
(
"、"
).
append
(
contend
.
getBrandName
()));
project
.
getContendList
().
forEach
(
contend
->
brandStr
.
append
(
"、"
).
append
(
contend
.
getBrandName
()));
}
}
questionPair
=
standardRequest
(
question
,
modelName
,
MessageFormat
.
format
(
QUESTION_PROMPT
,
brandStr
));
questionPair
=
standardRequest
(
question
,
modelName
,
MessageFormat
.
format
(
QUESTION_PROMPT
,
brandStr
));
if
(
Objects
.
isNull
(
questionPair
))
{
if
(
Objects
.
isNull
(
questionPair
)
||
Objects
.
equals
(
"无法回答"
,
questionPair
.
getLeft
())
)
{
return
null
;
return
null
;
}
}
JSONObject
json
=
JSON
.
parseObject
(
questionPair
.
getLeft
());
JSONObject
json
=
JSON
.
parseObject
(
questionPair
.
getLeft
());
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ToolsetServiceImpl.java
View file @
fd55f1af
...
@@ -561,7 +561,7 @@ public class ToolsetServiceImpl implements ToolsetService {
...
@@ -561,7 +561,7 @@ public class ToolsetServiceImpl implements ToolsetService {
List
<
BytedanceCustomEventUpdateTaskData
>
data
=
entry
.
getValue
();
List
<
BytedanceCustomEventUpdateTaskData
>
data
=
entry
.
getValue
();
BytedanceCustomEventUpdateTask
.
EventInfo
eventInfo
=
new
BytedanceCustomEventUpdateTask
.
EventInfo
();
BytedanceCustomEventUpdateTask
.
EventInfo
eventInfo
=
new
BytedanceCustomEventUpdateTask
.
EventInfo
();
eventInfo
.
setName
(
eventName
);
eventInfo
.
setName
(
eventName
);
eventInfo
.
setDataCount
(
data
.
size
(
));
eventInfo
.
setDataCount
(
Math
.
max
(
data
.
size
(),
1
));
// 计算影响力指数
// 计算影响力指数
eventInfo
.
setInfluence
(
computeInf
(
data
,
levelInfoMap
));
eventInfo
.
setInfluence
(
computeInf
(
data
,
levelInfoMap
));
eventInfoMap
.
put
(
eventName
,
eventInfo
);
eventInfoMap
.
put
(
eventName
,
eventInfo
);
...
@@ -717,7 +717,7 @@ public class ToolsetServiceImpl implements ToolsetService {
...
@@ -717,7 +717,7 @@ public class ToolsetServiceImpl implements ToolsetService {
private
Double
computeInf
(
List
<
BytedanceCustomEventUpdateTaskData
>
datas
,
Map
<
String
,
BytedanceCustomChannelLevelInfo
>
levelInfoMap
){
private
Double
computeInf
(
List
<
BytedanceCustomEventUpdateTaskData
>
datas
,
Map
<
String
,
BytedanceCustomChannelLevelInfo
>
levelInfoMap
){
Map
<
String
,
Double
>
levelSumH
=
new
HashMap
<>(
5
);
Map
<
String
,
Double
>
levelSumH
=
new
HashMap
<>(
5
);
if
(
CollectionUtils
.
isEmpty
(
datas
)){
if
(
CollectionUtils
.
isEmpty
(
datas
)){
return
0
d
;
return
1
d
;
}
}
for
(
BytedanceCustomEventUpdateTaskData
data
:
datas
)
{
for
(
BytedanceCustomEventUpdateTaskData
data
:
datas
)
{
// 匹配渠道影响力,微博、微信以外的平台一律按照”网媒“处理
// 匹配渠道影响力,微博、微信以外的平台一律按照”网媒“处理
...
@@ -757,7 +757,8 @@ public class ToolsetServiceImpl implements ToolsetService {
...
@@ -757,7 +757,8 @@ public class ToolsetServiceImpl implements ToolsetService {
// 3.各自乘以权重 结果相加
// 3.各自乘以权重 结果相加
result
=
INF
.
multiply
(
BigDecimal
.
valueOf
(
levelInfo
.
getWeight
())).
add
(
BigDecimal
.
valueOf
(
result
)).
doubleValue
();
result
=
INF
.
multiply
(
BigDecimal
.
valueOf
(
levelInfo
.
getWeight
())).
add
(
BigDecimal
.
valueOf
(
result
)).
doubleValue
();
}
}
return
BigDecimal
.
valueOf
(
result
).
setScale
(
1
,
RoundingMode
.
HALF_UP
).
doubleValue
();
double
resVal
=
BigDecimal
.
valueOf
(
result
).
setScale
(
1
,
RoundingMode
.
HALF_UP
).
doubleValue
();
return
resVal
>
1
?
resVal
:
1
d
;
}
}
private
double
getMatchedDefaultChannelInf
(
String
level
){
private
double
getMatchedDefaultChannelInf
(
String
level
){
...
@@ -781,6 +782,9 @@ public class ToolsetServiceImpl implements ToolsetService {
...
@@ -781,6 +782,9 @@ public class ToolsetServiceImpl implements ToolsetService {
* @return
* @return
*/
*/
private
Double
computeRMI
(
List
<
BytedanceCustomEventUpdateTaskData
>
data
){
private
Double
computeRMI
(
List
<
BytedanceCustomEventUpdateTaskData
>
data
){
if
(
CollectionUtils
.
isEmpty
(
data
)){
return
1
d
;
}
// 1、初始值
// 1、初始值
// 微信文章数
// 微信文章数
int
wechatArticle
=
(
int
)
data
.
stream
().
filter
(
article
->
Objects
.
equals
(
"微信"
,
article
.
getPlatformType
())).
count
();
int
wechatArticle
=
(
int
)
data
.
stream
().
filter
(
article
->
Objects
.
equals
(
"微信"
,
article
.
getPlatformType
())).
count
();
...
@@ -875,7 +879,7 @@ public class ToolsetServiceImpl implements ToolsetService {
...
@@ -875,7 +879,7 @@ public class ToolsetServiceImpl implements ToolsetService {
// 头条互动数:TI标= ln(TI+1)/ln(TI常+1)*100.0
// 头条互动数:TI标= ln(TI+1)/ln(TI常+1)*100.0
BigDecimal
TI
=
BigDecimal
.
valueOf
(
Math
.
log
(
toutiaoInteraction
+
1
)).
divide
(
BigDecimal
.
valueOf
(
Math
.
log
(
toutiaoInteractionWeight
.
getConstant
()
+
1
)),
20
,
RoundingMode
.
HALF_UP
).
multiply
(
bigDecimal100
);
BigDecimal
TI
=
BigDecimal
.
valueOf
(
Math
.
log
(
toutiaoInteraction
+
1
)).
divide
(
BigDecimal
.
valueOf
(
Math
.
log
(
toutiaoInteractionWeight
.
getConstant
()
+
1
)),
20
,
RoundingMode
.
HALF_UP
).
multiply
(
bigDecimal100
);
// 标准值与权重计算取和得RMI
// 标准值与权重计算取和得RMI
return
NM
.
multiply
(
BigDecimal
.
valueOf
(
normalMediaArticleWeight
.
getWeight
()))
double
resVal
=
NM
.
multiply
(
BigDecimal
.
valueOf
(
normalMediaArticleWeight
.
getWeight
()))
.
add
(
OM
.
multiply
(
BigDecimal
.
valueOf
(
otherPlatformArticleWeight
.
getWeight
())))
.
add
(
OM
.
multiply
(
BigDecimal
.
valueOf
(
otherPlatformArticleWeight
.
getWeight
())))
.
add
(
WC
.
multiply
(
BigDecimal
.
valueOf
(
wechatArticleWeight
.
getWeight
())))
.
add
(
WC
.
multiply
(
BigDecimal
.
valueOf
(
wechatArticleWeight
.
getWeight
())))
.
add
(
WCR
.
multiply
(
BigDecimal
.
valueOf
(
wechatReadWeight
.
getWeight
())))
.
add
(
WCR
.
multiply
(
BigDecimal
.
valueOf
(
wechatReadWeight
.
getWeight
())))
...
@@ -887,6 +891,7 @@ public class ToolsetServiceImpl implements ToolsetService {
...
@@ -887,6 +891,7 @@ public class ToolsetServiceImpl implements ToolsetService {
.
add
(
TI
.
multiply
(
BigDecimal
.
valueOf
(
toutiaoInteractionWeight
.
getWeight
())))
.
add
(
TI
.
multiply
(
BigDecimal
.
valueOf
(
toutiaoInteractionWeight
.
getWeight
())))
.
setScale
(
1
,
RoundingMode
.
HALF_UP
)
.
setScale
(
1
,
RoundingMode
.
HALF_UP
)
.
doubleValue
();
.
doubleValue
();
return
resVal
>
1
?
resVal
:
1
d
;
}
}
/**
/**
...
...
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