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
4b630acb
Commit
4b630acb
authored
Dec 04, 2019
by
rico.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update category attribute
parent
5f7fb6dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
16 deletions
+40
-16
VW_Relation_Property.xlsx
VW_Relation_Property.xlsx
+0
-0
YEDDA_Annotator.py
YEDDA_Annotator.py
+40
-16
No files found.
VW_Relation_Property.xlsx
0 → 100644
View file @
4b630acb
File added
YEDDA_Annotator.py
View file @
4b630acb
...
...
@@ -18,6 +18,7 @@ import pickle
import
os.path
import
platform
import
codecs
import
pandas
as
pd
from
utils.recommend
import
*
...
...
@@ -83,21 +84,22 @@ class Example(Frame):
#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
zgcCatCode
=
'0101'
relationDf
=
pd
.
read_excel
(
'VW_Relation_Property.xlsx'
,
converters
=
{
'SubCategoryCode'
:
str
})
relationFilter
=
relationDf
[(
relationDf
[
'SubCategoryCode'
]
==
zgcCatCode
)
&
((
relationDf
[
'ISimportant'
]
==
1
)
|
relationDf
[
'ispeijian'
]
==
1
)][[
'SubTitle'
]]
.
reset_index
()
del
relationFilter
[
'index'
]
if
relationFilter
.
empty
:
self
.
pressCommand
=
{
'1'
:
"error"
}
else
:
relationDict
=
dict
([(
str
(
k
),
v
)
for
k
,
v
in
zip
(
relationFilter
.
to_dict
()[
'SubTitle'
]
.
keys
(),
relationFilter
.
to_dict
()[
'SubTitle'
]
.
values
())])
self
.
pressCommand
=
relationDict
if
len
(
self
.
pressCommand
)
>
20
:
self
.
textRow
=
len
(
self
.
pressCommand
)
else
:
self
.
textRow
=
20
def
run_initUI
(
self
):
self
.
initUI
()
...
...
@@ -869,11 +871,33 @@ def decompositCommand(command_string):
def
main
():
print
(
u"启动 YEDDA 标注工具!"
)
print
((
u"操作系统:
%
s"
)
%
(
platform
.
system
()))
box
=
Tk
()
box
.
title
(
"请输入要标注的指数类别编码"
)
box
.
geometry
(
'300x300'
)
l1
=
Label
(
box
,
text
=
"指数类别:"
)
l1
.
pack
()
cat_text
=
StringVar
()
cat
=
Entry
(
box
,
textvariable
=
cat_text
)
cat_text
.
set
(
" "
)
cat
.
pack
()
def
on_click
():
x
=
cat_text
.
get
()
string
=
str
(
"指数类别:
%
s"
%
(
x
))
print
(
"指数类别:
%
s"
%
(
x
))
messagebox
.
showinfo
(
title
=
'Success'
,
message
=
string
)
Button
(
box
,
text
=
"确认"
,
command
=
on_click
)
.
pack
()
box
.
mainloop
()
catCode
=
str
(
cat_text
.
get
())
.
strip
()
root
=
Tk
()
root
.
geometry
(
"1300x700+200+200"
)
app
=
Example
(
root
)
app
.
setFont
(
17
)
app
.
setPressCommand
(
'0101'
)
app
.
setPressCommand
(
catCode
)
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