#include <ner_tagger_mod.h>
|
| NERTagger (TiCC::LogStream *, TiCC::LogStream *=0) |
|
bool | init (const TiCC::Configuration &) |
|
void | Classify (frog_data &) |
|
void | post_process (frog_data &) |
|
void | post_process (frog_data &, const std::vector< tc_pair > &) |
|
void | add_declaration (folia::Document &, folia::processor *) const |
|
void | add_result (const frog_data &fd, const std::vector< folia::Word * > &wv) const |
|
bool | read_gazets (const std::string &f, const std::string &p) |
|
bool | read_overrides (const std::string &f, const std::string &p) |
|
std::vector< std::string > | create_ner_list (const std::vector< std::string > &s) |
|
std::vector< std::string > | create_override_list (const std::vector< std::string > &s) |
|
bool | Generate (const std::string &) |
|
void | merge_override (std::vector< tc_pair > &, const std::vector< tc_pair > &, bool, const std::vector< std::string > &) const |
|
| BaseTagger (TiCC::LogStream *, TiCC::LogStream *, const std::string &) |
|
virtual | ~BaseTagger () |
|
void | add_provenance (folia::Document &, folia::processor *) const |
|
std::string | getTagset () const |
|
std::string | set_eos_mark (const std::string &) |
|
bool | fill_map (const std::string &, std::map< std::string, std::string > &) |
|
std::vector< Tagger::TagResult > | tagLine (const std::string &) |
|
std::vector< Tagger::TagResult > | tag_entries (const std::vector< tag_entry > &) |
|
std::string | version () const |
|
◆ NERTagger()
NERTagger::NERTagger |
( |
TiCC::LogStream * |
l, |
|
|
TiCC::LogStream * |
d = 0 |
|
) |
| |
|
explicit |
initialize a NERTagger instance
- Parameters
-
l | a LogStream for errors |
d | a LogStream for debugging |
◆ add_declaration()
void NERTagger::add_declaration |
( |
folia::Document & |
doc, |
|
|
folia::processor * |
proc |
|
) |
| const |
|
virtual |
add ENTITY annotation as an AnnotationType to the document
- Parameters
-
doc | the Document the add to |
proc | the processor to add |
Implements BaseTagger.
◆ add_result()
void NERTagger::add_result |
( |
const frog_data & |
fd, |
|
|
const std::vector< folia::Word * > & |
wv |
|
) |
| const |
add the NER tags in 'fd' to the FoLiA list of Word
- Parameters
-
fd | The tagged results |
wv | The folia:Word vector |
◆ Classify()
void NERTagger::Classify |
( |
frog_data & |
swords | ) |
|
|
virtual |
Tag one sentence, given in frog_data format
- Parameters
-
When tagging succeeds, 'swords' will be extended with the tag results
Reimplemented from BaseTagger.
◆ create_ner_list()
std::vector<std::string> NERTagger::create_ner_list |
( |
const std::vector< std::string > & |
s | ) |
|
|
inline |
◆ create_override_list()
std::vector<std::string> NERTagger::create_override_list |
( |
const std::vector< std::string > & |
s | ) |
|
|
inline |
◆ Generate()
bool NERTagger::Generate |
( |
const std::string & |
opt_line | ) |
|
generate a new tagger using opt_line
◆ init()
bool NERTagger::init |
( |
const TiCC::Configuration & |
config | ) |
|
|
virtual |
initalize a NER tagger from 'config'
- Parameters
-
config | the TiCC::Configuration |
- Returns
- true on succes, false otherwise
first BaseTagger::init() is called to set generic values, then the NER specific values for the gazeteer file-names etc. are added and the files are read.
Reimplemented from BaseTagger.
◆ merge_override()
void NERTagger::merge_override |
( |
std::vector< tc_pair > & |
tags, |
|
|
const std::vector< tc_pair > & |
overrides, |
|
|
bool |
unconditional, |
|
|
const std::vector< std::string > & |
POS_tags |
|
) |
| const |
merge overrides into the tc_pair vector
- Parameters
-
tags | the list of tc_pair to merge into |
overrides | the override information (from gazeteers and such) |
unconditional | when true, prefer the information from overrides, otherwise only override when there was no tag assigned yet |
POS_tags | a list of POS-tags. When this list is non-empty, only override when it contains a N or a SPEC tag. |
◆ post_process() [1/2]
◆ post_process() [2/2]
void NERTagger::post_process |
( |
frog_data & |
sentence, |
|
|
const std::vector< tc_pair > & |
ners |
|
) |
| |
finish the NER processs by updating 'sentence'
- Parameters
-
sentence | a frog_data structure to update with NER info |
ners | a sequence of NE tags (maybe 'O') with their confidence |
This is a specialized version local to NERTagger. Don't use the norma; post_process()
◆ read_gazets()
bool NERTagger::read_gazets |
( |
const std::string & |
f, |
|
|
const std::string & |
p |
|
) |
| |
|
inline |
◆ read_overrides()
bool NERTagger::read_overrides |
( |
const std::string & |
f, |
|
|
const std::string & |
p |
|
) |
| |
|
inline |
The documentation for this class was generated from the following files: