Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
text-mining-workflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
INSTANCE de PREPROD
Les données peuvent être supprimées à tout moment.
Show more breadcrumbs
Omnicrobe
text-mining-workflow
Commits
3ced64e2
Commit
3ced64e2
authored
2 years ago
by
Mouhamadou Ba
Browse files
Options
Downloads
Patches
Plain Diff
Update softwares/scripts/to-html.py
parent
5391591b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
softwares/scripts/to-html.py
+42
-0
42 additions, 0 deletions
softwares/scripts/to-html.py
with
42 additions
and
0 deletions
softwares/scripts/to-html.py
+
42
−
0
View file @
3ced64e2
import
os
import
pandas
import
csv
import
json
def
get_score
(
jfile
,
entityList
=
[
"
Standard scoring
"
],
corpus
=
"
BB
"
,
task
=
"
BB-norm
"
):
dict
=
{
"
Corpus
"
:[],
"
Task
"
:[],
"
Pairing
"
:[],
"
Score Scope
"
:[],
"
Score Name
"
:
[],
"
Value
"
:
[]}
data
=
json
.
load
(
open
(
jfile
))
for
d
in
(
data
[
'
evaluation
'
])[
'
global-evaluations
'
]:
scorings
=
d
[
'
scorings
'
]
for
s
in
scorings
:
if
s
[
'
name
'
]
in
entityList
:
for
m
in
s
[
'
measures
'
]:
dict
[
"
Corpus
"
].
append
(
corpus
)
dict
[
"
Task
"
].
append
(
task
)
dict
[
"
Pairing
"
].
append
(
d
[
'
name
'
])
dict
[
"
Score Scope
"
].
append
(
s
[
'
name
'
])
dict
[
"
Score Name
"
].
append
(
m
[
'
name
'
])
dict
[
"
Value
"
].
append
(
m
[
'
value
'
])
return
dict
def
get_score_norm
(
jfile
):
return
get_score
(
jfile
,
entityList
=
[
"
Standard scoring
"
,
"
Habitats
"
,
"
Phenotypes
"
,
"
Microorganisms
"
],
corpus
=
"
BB19
"
,
task
=
"
BB-norm
"
)
def
get_score_kb
(
jfile
):
return
get_score
(
jfile
,
entityList
=
[
"
Standard scoring
"
],
corpus
=
"
BB
"
,
task
=
"
BB-kb
"
)
def
get_score_rel
(
jfile
):
return
get_score
(
jfile
,
entityList
=
[
"
Standard scoring
"
,
"
Lives_In and Exhibits
"
,
"
Lives_In
"
,
"
Exhibits
"
],
corpus
=
"
BB
"
,
task
=
"
BB-rel
"
)
# Main
if
__name__
==
'
__main__
'
:
import
sys
from
optparse
import
OptionParser
,
OptionGroup
optparser
=
OptionParser
(
usage
=
"
%extract data from genbank bank
"
)
group
=
OptionGroup
(
optparser
,
"
Main Options
"
,
""
)
optparser
.
add_option
(
"
-t
"
,
"
--file
"
,
default
=
"
None
"
,
dest
=
"
taxo_ref
"
,
help
=
""
,
metavar
=
"
FILE
"
)
optparser
.
add_option
(
"
-d
"
,
"
--task
"
,
default
=
"
None
"
,
dest
=
"
db_path
"
,
help
=
""
,
metavar
=
"
FILE
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment