use std::fs;
use crfs::Model;
use pos_test::PartOfSpeechTagger;
fn main() {
let model = fs::read("./pos.crf").unwrap();
let model = Model::new(&model).unwrap();
let mut tagger = PartOfSpeechTagger::new(&model, Default::default()).unwrap();
let sentence = "The quick brown fox jumped over the lazy dog.";
let results = tagger.tag(&sentence.split_ascii_whitespace().collect::<Vec<_>>()).unwrap();
for part in results {
print!("{part} ");
}
println!();
}
I'm using
crfs
for part-of-speech tagging and I noticed the output is very different compared tocrfsuite-rs
.With the input
The quick brown fox jumped over the lazy dog
:Tagging code using
crfs
Model:pos.crf
Test script: