Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Carlos-Francisco Méndez-Cruz
/
conditional-random-fields
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Carlos-Francisco Méndez-Cruz
2018-03-08 01:25:24 -0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4df2dfa637436dc940ede25ad97e1a4f104577bb
4df2dfa6
1 parent
a709b026
Obtaining training and test data sets
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
prepare-training-test.py
prepare-training-test.py
View file @
4df2dfa
...
...
@@ -63,13 +63,13 @@ if __name__ == "__main__":
# For each file in dir
for
file
in
files
:
if
counter
<=
70
:
print
(
" Joining file {}
to training data set"
.
format
(
file
))
print
(
" Joining file {}
{} to training data set"
.
format
(
counter
,
file
))
with
open
(
os
.
path
.
join
(
path
,
file
),
"r"
,
encoding
=
"utf-8"
,
errors
=
"replace"
)
as
iFile
:
for
line
in
iFile
:
line
=
line
.
strip
(
'
\r\n
'
)
trainingDataset
.
append
(
line
)
elif
counter
>
70
and
counter
<=
100
:
print
(
" Joining file {}
to test data set"
.
format
(
file
))
print
(
" Joining file {}
{} to test data set"
.
format
(
counter
,
file
))
with
open
(
os
.
path
.
join
(
path
,
file
),
"r"
,
encoding
=
"utf-8"
,
errors
=
"replace"
)
as
iFile
:
for
line
in
iFile
:
line
=
line
.
strip
(
'
\r\n
'
)
...
...
Please
register
or
login
to post a comment