Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SequenceLabelingTool
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ZGC_INDEX
SequenceLabelingTool
Commits
5f7fb6dd
Commit
5f7fb6dd
authored
Dec 04, 2019
by
rico.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update_pressCommand
parent
c616385f
Pipeline
#87
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
19 deletions
+44
-19
YEDDA_Annotator.py
YEDDA_Annotator.py
+44
-19
No files found.
YEDDA_Annotator.py
View file @
5f7fb6dd
...
...
@@ -26,7 +26,7 @@ class Example(Frame):
"""TODO 换成更贴切的类名"""
def
__init__
(
self
,
parent
):
Frame
.
__init__
(
self
,
parent
)
self
.
Version
=
u"
YEDDA
-V1.0 标注工具"
self
.
Version
=
u"
ZGC_INDEX
-V1.0 标注工具"
self
.
OS
=
platform
.
system
()
.
lower
()
self
.
parent
=
parent
self
.
fileName
=
""
...
...
@@ -35,26 +35,29 @@ class Example(Frame):
self
.
recommendFlag
=
True
self
.
history
=
deque
(
maxlen
=
20
)
self
.
currentContent
=
deque
(
maxlen
=
1
)
self
.
pressCommand
=
{
'a'
:
"Artifical"
,
'b'
:
"Event"
,
'c'
:
"Fin-Concept"
,
'd'
:
"Location"
,
'e'
:
"Organization"
,
'f'
:
"Person"
,
'g'
:
"Sector"
,
'h'
:
"Other"
'''
self.pressCommand = {'1':"Artifical",
'2':"Event",
'3':"Fin-Concept",
'4':"Location",
'5':"Organization",
'6':"Person",
'7':"Sector",
'8':"Other"
}
'''
self
.
allKey
=
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
self
.
controlCommand
=
{
'q'
:
"unTag"
,
'ctrl+z'
:
'undo'
}
self
.
labelEntryList
=
[]
self
.
shortcutLabelList
=
[]
# 默认 GUI 显示参数
if
len
(
self
.
pressCommand
)
>
20
:
self
.
textRow
=
len
(
self
.
pressCommand
)
else
:
self
.
textRow
=
20
#
if len(self.pressCommand) > 20:
#
self.textRow = len(self.pressCommand)
#
else:
#
self.textRow = 20
self
.
textColumn
=
5
self
.
tagScheme
=
"B
MES
"
self
.
tagScheme
=
"B
IO
"
self
.
onlyNP
=
False
## for exporting sequence
self
.
keepRecommend
=
True
...
...
@@ -77,6 +80,26 @@ class Example(Frame):
self
.
recommendColor
=
'lightgreen'
self
.
selectColor
=
'light salmon'
self
.
textFontStyle
=
"Times"
#self.initUI()
def
setPressCommand
(
self
,
zgcCatCode
):
if
zgcCatCode
==
'0101'
:
self
.
pressCommand
=
{
'1'
:
"Artifical"
,
'2'
:
"Event"
,
'3'
:
"Fin-Concept"
,
'4'
:
"Location"
,
'5'
:
"Organization"
,
'6'
:
"Person"
,
'7'
:
"Sector"
,
'8'
:
"Other"
,
'9'
:
'liuxiaoqi'
}
if
len
(
self
.
pressCommand
)
>
20
:
self
.
textRow
=
len
(
self
.
pressCommand
)
else
:
self
.
textRow
=
20
def
run_initUI
(
self
):
self
.
initUI
()
def
initUI
(
self
):
...
...
@@ -104,19 +127,19 @@ class Example(Frame):
self
.
sb
[
'command'
]
=
self
.
text
.
yview
# self.sb.pack()
abtn
=
Button
(
self
,
text
=
"
Open
"
,
command
=
self
.
onOpen
)
abtn
=
Button
(
self
,
text
=
"
加载文件
"
,
command
=
self
.
onOpen
)
abtn
.
grid
(
row
=
1
,
column
=
self
.
textColumn
+
1
)
recButton
=
Button
(
self
,
text
=
"
RMOn
"
,
command
=
self
.
setInRecommendModel
)
recButton
=
Button
(
self
,
text
=
"
推荐开启
"
,
command
=
self
.
setInRecommendModel
)
recButton
.
grid
(
row
=
2
,
column
=
self
.
textColumn
+
1
)
noRecButton
=
Button
(
self
,
text
=
"
RMOff
"
,
command
=
self
.
setInNotRecommendModel
)
noRecButton
=
Button
(
self
,
text
=
"
推荐关闭
"
,
command
=
self
.
setInNotRecommendModel
)
noRecButton
.
grid
(
row
=
3
,
column
=
self
.
textColumn
+
1
)
ubtn
=
Button
(
self
,
text
=
"
ReMap
"
,
command
=
self
.
renewPressCommand
)
ubtn
=
Button
(
self
,
text
=
"
保存快捷键
"
,
command
=
self
.
renewPressCommand
)
ubtn
.
grid
(
row
=
4
,
column
=
self
.
textColumn
+
1
,
pady
=
4
)
exportbtn
=
Button
(
self
,
text
=
"
Export
"
,
command
=
self
.
generateSequenceFile
)
exportbtn
=
Button
(
self
,
text
=
"
导出anns
"
,
command
=
self
.
generateSequenceFile
)
exportbtn
.
grid
(
row
=
5
,
column
=
self
.
textColumn
+
1
,
pady
=
4
)
cbtn
=
Button
(
self
,
text
=
"Quit"
,
command
=
self
.
quit
)
...
...
@@ -850,6 +873,8 @@ def main():
root
.
geometry
(
"1300x700+200+200"
)
app
=
Example
(
root
)
app
.
setFont
(
17
)
app
.
setPressCommand
(
'0101'
)
app
.
run_initUI
()
root
.
mainloop
()
...
...
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