Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DA-Platform
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
文档服务地址:
http://47.92.0.57:3000/
周报索引地址:
http://47.92.0.57:3000/s/NruNXRYmV
Open sidebar
Berlin
DA-Platform
Commits
1cef778b
Commit
1cef778b
authored
Nov 03, 2020
by
wyy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
得分计算
parent
4b6776ce
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
21 deletions
+83
-21
SelectedCheck.vue
...orm-front/src/components/textAnnotation/SelectedCheck.vue
+38
-13
TabledCheck.vue
...tform-front/src/components/textAnnotation/TabledCheck.vue
+45
-8
No files found.
DAPlatform-front/src/components/textAnnotation/SelectedCheck.vue
View file @
1cef778b
...
@@ -44,21 +44,16 @@
...
@@ -44,21 +44,16 @@
v-for=
"it in tokenList"
v-for=
"it in tokenList"
:key=
"it"
:key=
"it"
style=
"user-select:none; float: left;"
style=
"user-select:none; float: left;"
@
click=
"changeToken(it)"
:disable-transitions=
"false"
:disable-transitions=
"false"
>
>
<el-checkbox>
<el-checkbox
v-model=
"it.checked"
@
change=
"countScore(it)"
>
<a
@
click=
"changeToken(it)"
>
<a
style=
"font-size: 18px;"
v-html=
"it.word"
></a>
<a
style=
"font-size: 18px;"
v-html=
"it.word"
></a>
<a
style=
"font-size: 14px;"
>
: 实体
</a>
<a
style=
"font-size: 14px;"
>
: 实体
</a>
<a
style=
"font-size: 14px;"
v-html=
"it.entityId"
></a>
<a
style=
"font-size: 14px;"
v-html=
"it.entityId"
></a>
<a
style=
"font-size: 14px;"
>
属性
</a>
<a
style=
"font-size: 14px;"
>
属性
</a>
<a
style=
"font-size: 14px;"
v-html=
"it.attribute"
></a>
<a
style=
"font-size: 14px;"
v-html=
"it.attribute"
></a>
<!--el-button
</a>
style="margin-left: auto;font-size: 12px"
@click="countScore()"
size="mini"
type="text"
>O
</el-button-->
</el-checkbox>
</el-checkbox>
</div>
</div>
</div>
</div>
...
@@ -93,6 +88,7 @@ export default {
...
@@ -93,6 +88,7 @@ export default {
end
:
0
,
end
:
0
,
entityId
:
""
,
entityId
:
""
,
attribute
:
[],
attribute
:
[],
checked
:
false
,
},
},
token
:
{
token
:
{
tokenId
:
""
,
tokenId
:
""
,
...
@@ -101,6 +97,7 @@ export default {
...
@@ -101,6 +97,7 @@ export default {
end
:
0
,
end
:
0
,
entityId
:
""
,
entityId
:
""
,
attribute
:
[],
attribute
:
[],
checked
:
false
,
},
},
// 实体属性列表
// 实体属性列表
tokenList
:
[],
tokenList
:
[],
...
@@ -118,6 +115,7 @@ export default {
...
@@ -118,6 +115,7 @@ export default {
accuracy
:
""
,
accuracy
:
""
,
score
:
""
,
score
:
""
,
},
},
rightTokenList
:
[],
formLabelWidth
:
"120px"
,
formLabelWidth
:
"120px"
,
executors
:
[],
executors
:
[],
computeScore
:
0
,
computeScore
:
0
,
...
@@ -146,11 +144,33 @@ export default {
...
@@ -146,11 +144,33 @@ export default {
}
}
this
.
uploadToken
();
this
.
uploadToken
();
},
},
countScore
()
{
countScore
(
selectToken
)
{
this
.
rightScore
++
;
var
flag
=
true
;
console
.
log
(
this
.
rightTokenList
);
for
(
var
i
=
0
;
i
<
this
.
rightTokenList
.
length
;
i
++
){
if
(
selectToken
.
word
==
this
.
rightTokenList
[
i
].
word
){
flag
=
false
;
this
.
rightTokenList
.
splice
(
i
,
1
);
this
.
tokenList
.
forEach
((
element
)
=>
{
if
(
selectToken
.
word
==
element
.
word
){
element
.
checked
=
false
;
}
})
}
}
if
(
flag
==
true
){
this
.
tokenList
.
forEach
((
element
)
=>
{
if
(
selectToken
.
word
==
element
.
word
){
this
.
rightTokenList
.
push
(
element
);
element
.
checked
=
true
;
}
})
}
this
.
rightScore
=
this
.
rightTokenList
.
length
;
this
.
allScore
=
this
.
tokenList
.
length
;
this
.
computeScore
=
(
this
.
rightScore
/
this
.
allScore
)
*
100
;
this
.
computeScore
=
(
this
.
rightScore
/
this
.
allScore
)
*
100
;
console
.
log
(
this
.
rightScore
);
console
.
log
(
this
.
computeScore
)
console
.
log
(
this
.
allScore
);
//
console.log(this.allScore);
},
},
// 插入数据库
// 插入数据库
insertDocument
()
{
insertDocument
()
{
...
@@ -232,7 +252,11 @@ export default {
...
@@ -232,7 +252,11 @@ export default {
this
.
allScore
=
0
;
this
.
allScore
=
0
;
res
.
result
.
forEach
((
element
)
=>
{
res
.
result
.
forEach
((
element
)
=>
{
this
.
tokenInit
=
element
;
this
.
tokenInit
=
element
;
this
.
allScore
++
;
this
.
tokenInit
.
checked
=
false
;
this
.
rightTokenList
.
forEach
((
item
)
=>
{
if
(
item
.
word
==
this
.
tokenInit
.
word
)
this
.
tokenInit
.
checked
=
true
;
})
console
.
log
(
" token: "
+
JSON
.
stringify
(
this
.
tokenInit
));
console
.
log
(
" token: "
+
JSON
.
stringify
(
this
.
tokenInit
));
this
.
tokenList
.
push
(
this
.
tokenInit
);
this
.
tokenList
.
push
(
this
.
tokenInit
);
let
replaceReg
=
new
RegExp
(
this
.
tokenInit
.
word
,
"g"
);
// 匹配关键字正则
let
replaceReg
=
new
RegExp
(
this
.
tokenInit
.
word
,
"g"
);
// 匹配关键字正则
...
@@ -425,6 +449,7 @@ export default {
...
@@ -425,6 +449,7 @@ export default {
this
.
token
.
begin
=
tag
.
begin
;
this
.
token
.
begin
=
tag
.
begin
;
this
.
token
.
end
=
tag
.
end
;
this
.
token
.
end
=
tag
.
end
;
this
.
token
.
entityId
=
tag
.
entityId
;
this
.
token
.
entityId
=
tag
.
entityId
;
this
.
token
.
checked
=
tag
.
checked
;
let
res
=
[];
let
res
=
[];
for
(
var
i
=
0
;
i
<
this
.
treeToArray
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
treeToArray
.
length
;
i
++
)
{
res
[
i
]
=
{};
res
[
i
]
=
{};
...
...
DAPlatform-front/src/components/textAnnotation/TabledCheck.vue
View file @
1cef778b
...
@@ -84,21 +84,16 @@
...
@@ -84,21 +84,16 @@
v-for=
"it in tokenList"
v-for=
"it in tokenList"
:key=
"it"
:key=
"it"
style=
"user-select:none; float: left;"
style=
"user-select:none; float: left;"
@
click=
"changeToken(it)"
:disable-transitions=
"false"
:disable-transitions=
"false"
>
>
<el-checkbox>
<el-checkbox
v-model=
"it.checked"
@
change=
"countScore(it)"
>
<a
@
click=
"changeToken(it)"
>
<a
style=
"font-size: 18px;"
v-html=
"it.word"
></a>
<a
style=
"font-size: 18px;"
v-html=
"it.word"
></a>
<a
style=
"font-size: 14px;"
>
: 实体
</a>
<a
style=
"font-size: 14px;"
>
: 实体
</a>
<a
style=
"font-size: 14px;"
v-html=
"it.entityId"
></a>
<a
style=
"font-size: 14px;"
v-html=
"it.entityId"
></a>
<a
style=
"font-size: 14px;"
>
属性
</a>
<a
style=
"font-size: 14px;"
>
属性
</a>
<a
style=
"font-size: 14px;"
v-html=
"it.attribute"
></a>
<a
style=
"font-size: 14px;"
v-html=
"it.attribute"
></a>
<!--el-button
</a>
style="margin-left: auto;font-size: 12px"
@click="countScore()"
size="mini"
type="text"
>O
</el-button-->
</el-checkbox>
</el-checkbox>
</div>
</div>
</div>
</div>
...
@@ -133,6 +128,7 @@ export default {
...
@@ -133,6 +128,7 @@ export default {
end
:
0
,
end
:
0
,
entityId
:
""
,
entityId
:
""
,
attribute
:
[],
attribute
:
[],
checked
:
false
,
},
},
token
:
{
token
:
{
tokenId
:
""
,
// 编号
tokenId
:
""
,
// 编号
...
@@ -141,6 +137,7 @@ export default {
...
@@ -141,6 +137,7 @@ export default {
end
:
0
,
// 终止位置
end
:
0
,
// 终止位置
entityId
:
""
,
// column
entityId
:
""
,
// column
attribute
:
[],
// 属性
attribute
:
[],
// 属性
checked
:
false
,
},
},
row
:
[],
row
:
[],
column
:
{},
column
:
{},
...
@@ -166,6 +163,7 @@ export default {
...
@@ -166,6 +163,7 @@ export default {
tableData
:
[],
tableData
:
[],
name
:
[],
name
:
[],
},
},
rightTokenList
:
[],
allContent
:
[],
allContent
:
[],
numOfSheet
:
0
,
numOfSheet
:
0
,
commentScore
:
false
,
commentScore
:
false
,
...
@@ -176,6 +174,9 @@ export default {
...
@@ -176,6 +174,9 @@ export default {
formLabelWidth
:
"120px"
,
formLabelWidth
:
"120px"
,
executors
:
[],
executors
:
[],
treeToArray
:
[],
treeToArray
:
[],
computeScore
:
0
,
allScore
:
1
,
rightScore
:
0
};
};
},
},
beforeMount
()
{
beforeMount
()
{
...
@@ -197,6 +198,36 @@ export default {
...
@@ -197,6 +198,36 @@ export default {
}
}
this
.
uploadToken
();
this
.
uploadToken
();
},
},
countScore
(
selectToken
)
{
var
flag
=
true
;
for
(
var
i
=
0
;
i
<
this
.
rightTokenList
.
length
;
i
++
){
if
(
selectToken
.
word
==
this
.
rightTokenList
[
i
].
word
){
flag
=
false
;
this
.
rightTokenList
.
splice
(
i
,
1
);
this
.
tokenList
.
forEach
((
element
)
=>
{
if
(
selectToken
.
word
==
element
.
word
){
element
.
checked
=
false
;
}
})
}
}
if
(
flag
==
true
){
this
.
tokenList
.
forEach
((
element
)
=>
{
if
(
selectToken
.
word
==
element
.
word
){
this
.
rightTokenList
.
push
(
element
);
element
.
checked
=
true
;
}
})
}
console
.
log
(
this
.
rightTokenList
)
this
.
rightScore
=
this
.
rightTokenList
.
length
;
this
.
allScore
=
this
.
tokenList
.
length
;
if
(
this
.
allScore
==
0
){
this
.
allScore
=
1
;
}
this
.
computeScore
=
(
this
.
rightScore
/
this
.
allScore
)
*
100
;
// console.log(this.allScore);
},
// 插入数据库
// 插入数据库
insertDocument
()
{
insertDocument
()
{
// console.log("userId" + this.$store.state.userInfo.userId);
// console.log("userId" + this.$store.state.userInfo.userId);
...
@@ -274,6 +305,11 @@ export default {
...
@@ -274,6 +305,11 @@ export default {
if
(
res
.
return_code
==
200
)
{
if
(
res
.
return_code
==
200
)
{
res
.
result
.
forEach
((
element
)
=>
{
res
.
result
.
forEach
((
element
)
=>
{
this
.
tokenInit
=
element
;
this
.
tokenInit
=
element
;
this
.
tokenInit
.
checked
=
false
;
this
.
rightTokenList
.
forEach
((
item
)
=>
{
if
(
item
.
word
==
this
.
tokenInit
.
word
)
this
.
tokenInit
.
checked
=
true
;
})
console
.
log
(
" token: "
+
JSON
.
stringify
(
this
.
tokenInit
));
console
.
log
(
" token: "
+
JSON
.
stringify
(
this
.
tokenInit
));
this
.
tokenList
.
push
(
this
.
tokenInit
);
this
.
tokenList
.
push
(
this
.
tokenInit
);
});
});
...
@@ -471,6 +507,7 @@ export default {
...
@@ -471,6 +507,7 @@ export default {
this
.
token
.
begin
=
tag
.
begin
;
this
.
token
.
begin
=
tag
.
begin
;
this
.
token
.
end
=
tag
.
end
;
this
.
token
.
end
=
tag
.
end
;
this
.
token
.
entityId
=
tag
.
entityId
;
this
.
token
.
entityId
=
tag
.
entityId
;
this
.
token
.
checked
=
tag
.
checked
;
let
res
=
[];
let
res
=
[];
for
(
var
i
=
0
;
i
<
this
.
treeToArray
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
treeToArray
.
length
;
i
++
)
{
res
[
i
]
=
{};
res
[
i
]
=
{};
...
...
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