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 12:45:01 -0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7666e789f6fd9275349ea4de3b28b3698e37acc9
7666e789
1 parent
b7133bc2
Training validation script
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
training-validation-v1.py
training-validation-v1.py
View file @
7666e78
...
...
@@ -70,6 +70,7 @@ def word2features(sent, i):
#'word.isupper()': word.isupper(),
'word'
:
word
,
'lemma'
:
lemma
,
'postag'
:
postag
,
'lemma[-3:]'
:
lemma
[
-
3
:],
'lemma[-2:]'
:
lemma
[
-
2
:],
'lemma[-1:]'
:
lemma
[
-
1
:],
...
...
@@ -86,6 +87,7 @@ def word2features(sent, i):
features
.
update
({
'-1:word'
:
word1
,
'-1:lemma'
:
lemma1
,
'-1:postag'
:
postag1
,
})
if
i
<
len
(
sent
)
-
1
:
...
...
@@ -96,6 +98,7 @@ def word2features(sent, i):
features
.
update
({
'+1:word'
:
word1
,
'+1:lemma'
:
lemma1
,
'+1:postag'
:
postag1
,
})
'''
...
...
Please
register
or
login
to post a comment