Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Iobber
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Syntactic Tools
Chunking
Iobber
Commits
aefc58ff
There was an error fetching the commit references. Please try again later.
Commit
aefc58ff
authored
10 years ago
by
Radosław Warzocha
Browse files
Options
Downloads
Patches
Plain Diff
Making Iobber work with Wcrft2
parent
78267450
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iobber/iobber_txt.py
+9
-11
9 additions, 11 deletions
iobber/iobber_txt.py
with
9 additions
and
11 deletions
iobber/iobber_txt.py
+
9
−
11
View file @
aefc58ff
...
...
@@ -20,9 +20,7 @@ import sys
from
optparse
import
OptionParser
import
corpus2
from
wcrft
import
tagger
from
wcrft
import
corpio
as
tagger_io
import
wcrft2
import
chunker
...
...
@@ -111,7 +109,10 @@ def main(files, tagger_config, tagger_dir, shall_chunk,
"""
Create a Tagger (WCRFT) and a Chunker (IOBBER) object
and get all the input parts processed according to function args.
"""
tagr
=
tagger
.
Tagger
(
tagger_config
,
tagger_dir
)
tagr
=
wcrft2
.
Tagger
(
tagger_config
,
tagger_dir
)
tagset
=
tagr
.
get_tagset
()
maca_conf
=
tagr
.
get_maca_config
()
if
shall_chunk
:
chunkr
=
chunker
.
Chunker
(
chunker_config
,
chunker_dir
)
...
...
@@ -139,16 +140,13 @@ def main(files, tagger_config, tagger_dir, shall_chunk,
tagr
.
load_model
()
if
shall_chunk
:
chunkr
.
load_model
()
assert
(
tagr
.
tagset
.
name
()
==
chunkr
.
tagset
.
name
()),
(
'
Tagger and chunker config must
'
+
'
operate on the same tagset: %s v. %s
'
%
(
tagr
.
tagset
.
name
(),
chunkr
.
tagset
.
name
()))
assert
(
tagset
.
name
()
==
chunkr
.
tagset
.
name
()),
(
'
Tagger and chunker config must
'
+
'
operate on the same tagset: %s v. %s
'
%
(
tagset
.
name
(),
chunkr
.
tagset
.
name
()))
for
in_path
,
out_path
in
zip
(
inputs
,
outputs
):
if
in_path
and
verbose
:
sys
.
stderr
.
write
(
'
Processing %s...
\n
'
%
in_path
)
reader
=
tagger_io
.
get_reader
(
in_path
,
tagr
.
tagset
,
input_format
,
tagr
.
maca_config
)
writer
=
tagger_io
.
get_writer
(
out_path
,
tagr
.
tagset
,
output_format
)
reader
=
wcrft2
.
get_reader
(
in_path
,
input_format
,
tagset
,
maca_conf
)
writer
=
wcrft2
.
get_writer
(
out_path
,
output_format
,
tagset
)
while
True
:
par
=
reader
.
get_next_chunk
()
# here `chunk' denotes paragraph
if
not
par
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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