Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
802e5205
Commit
802e5205
authored
Jun 06, 2013
by
Davis King
Browse files
fixed bug
parent
c588d940
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
python_examples/sequence_segmenter.py
python_examples/sequence_segmenter.py
+6
-2
No files found.
python_examples/sequence_segmenter.py
View file @
802e5205
...
...
@@ -158,9 +158,13 @@ model = dlib.train_sequence_segmenter(training_sequences, segments, params)
for
i
in
range
(
len
(
sentences
)):
print_segment
(
sentences
[
i
],
model
.
segment_sequence
(
training_sequences
[
i
]))
# Lets also try segmenting a new sentence. This will print out "Bob Bucket"
# Lets also try segmenting a new sentence. This will print out "Bob Bucket". Note that we
# need to remember to use the same vector representation as we used during training.
test_sentence
=
"There once was a man from Nantucket whose name rhymed with Bob Bucket"
print_segment
(
test_sentence
,
model
.
segment_sequence
(
sentence_to_vectors
(
test_sentence
)))
if
use_sparse_vects
:
print_segment
(
test_sentence
,
model
.
segment_sequence
(
sentence_to_sparse_vectors
(
test_sentence
)))
else
:
print_segment
(
test_sentence
,
model
.
segment_sequence
(
sentence_to_vectors
(
test_sentence
)))
# We can also measure the accuracy of a model relative to some labeled data. This
# statement prints the precision, recall, and F1-score of the model relative to the data in
...
...
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