KJB
|
Namespaces | |
Key_slots | |
Step_code | |
Functions | |
std::ostream & | operator<< (std::ostream &, const Categorical_event_base &) |
display key in human readable form More... | |
template<size_t N> | |
Categorical_event< N-1 > | smooth (const Categorical_event< N > &event, const size_t steps=1) |
marginalizes look-up key by <steps> from back (generalizes context) More... | |
template<size_t N> | |
Categorical_event< N > | get_context (const Categorical_event< N > &event, const size_t steps=1) |
returns RHS of conditioning expression More... | |
Event_db | process_event_file (std::string train_path, std::string lexicon_file, size_t max_events, std::string test_path) |
Free_function definitions. More... | |
template<class T > | |
Key_slots::Map | initialize_map (boost::array< std::string, T::size > names) |
void | resample_all_event_alphas () |
template<class T , size_t N> | |
std::ostream & | operator<< (std::ostream &, const typename Marginal_cell< T, N >::Map &) |
template<class T > | |
std::ostream & | operator<< (std::ostream &, const typename Marginal_cell< T, 1 >::Map &) |
template<class T , size_t N> | |
std::ostream & | operator<< (std::ostream &, const typename Context_cell< T, N >::Map &) |
template<typename T , size_t N> | |
void | set_contingency_table_verbosity (bool value) |
void | resample_semspear_trees (std::vector< Semspear_tree::Self_ptr > &trees, const size_t &iterations, std::ostream &results, const bool &output_diagnostics) |
void | resample_associations (std::vector< Semspear_tree::Self_ptr > &trees, std::ostream &results, const bool &output_diagnostics) |
void | resample_event_tables (std::vector< Semspear_tree::Self_ptr > &trees) |
void | initialize_global_semantic_maps () |
std::ostream & | operator<< (std::ostream &os, Semantic_data_base::Hash_pair hash_pair) |
std::ostream & | operator<< (std::ostream &os, Semantic_elaboration::Self_ptr elab) |
template<class T , class Traits > | |
std::ostream & | operator<< (std::ostream &, Semantic_data< T, Traits >) |
const boost::shared_ptr < Null_semantic_terminal > & | null_semantic_terminal () |
creates a new "null" terminal node (w/ no semantic content) More... | |
template<typename T , size_t D> | |
std::ostream & | operator<< (std::ostream &os, const boost::array< T, D > &arr) |
Proposal | propose_a_step (const Elab_ptr_const semantic_parent, const Sem_event_ptr old_sem_event, const Syn_event_ptr old_syn_event, const Step_code_t step) |
double | calculate_proposal_probability (const Proposal &proposal, const bool &collins) |
boost::tuple< Proposal_array, Proposal_dist > | generate_all_proposals (const Elab_ptr_const semantic_parent, const Sem_event_ptr sem_event, const Syn_event_ptr syn_event, const Step_code_t &curr_step, const bool &tree_is_altered, const bool &collins) |
boost::shared_ptr < Object_elaboration > | make_plain_semantic_object (const Object_data::Val_type &category, const Semantic_elaboration::Referent_code &referent_code=Semantic_elaboration::NULL_REFERENT) |
create an object semantic node of category category, no attributes More... | |
void | initialize_semantic_maps () |
read in mappings from files, default config path More... | |
void | initialize_semantic_maps (const std::string config_file_path) |
read in mappings from files, config file path specified More... | |
void | initialize_semantic_maps (const std::map< std::string, std::string > &config_file_path_map) |
read in mappings from files, map with specified data type config paths More... | |
std::vector< Step_code::Weights > | step_code_priors_by_elaboration_type () |
const std::vector < Step_code::Weights > & | step_code_priors () |
Sentence_sem | build_semantic_tree (size_t index) |
std::vector< Sentence_sem > | collect_semantic_trees () |
template<> | |
string | enum_to_string< Step_code_t > (Step_code_t value) |
template<typename Enum_type > | |
std::string | enum_to_string (Enum_type) |
template<typename Enum_type > | |
Enum_type | string_to_enum (std::string) |
template<> | |
std::string | enum_to_string< Step_code_t > (Step_code_t) |
const Symbol_list | punctuation (punc.begin(), punc.end()) |
const Symbol_list | base_np_labels (base_np.begin(), base_np.end()) |
const Symbol_list | coordination (coord.begin(), coord.end()) |
const Symbol_list | accepts_any_coord (acc_any.begin(), acc_any.end()) |
const Symbol_list & | unnecessary_nodes () |
boost::tuple < Semspear_tree::Self_ptr, kjb::Vector > | propose_new_tree (const Semspear_tree::Self_ptr source) |
void | resample_event_tables (Semspear_tree::Self_ptr &source) |
void | initialize_special_symbols () |
std::ostream & | operator<< (std::ostream &os, Token_map &map) |
template<class T > | |
void | multi_encode (Token_map &map, const T &keys) |
template<class T , class U , class M > | |
T | multi_map_encode (M maps, U keys) |
template<class U , class T , class M > | |
U | multi_map_decode (M maps, T vals) |
template<class T > | |
void | set_verbosity (bool verbose) |
template<class T > | |
std::ostream & | operator<< (std::ostream &os, const std::vector< T > &c) |
Variables | |
boost::array< size_t, S1_traits::context_levels > | tmp_s1 = {{1}} |
boost::array< size_t, S2_traits::context_levels > | tmp_s2 = {{1,2}} |
boost::array< size_t, U_traits::context_levels > | tmp_u = {{1,1,1}} |
boost::array< size_t, D1_traits::context_levels > | tmp_d1 = {{3,1,1}} |
boost::array< size_t, D2_traits::context_levels > | tmp_d2 = {{1,7,1}} |
boost::array< size_t, PCC1_traits::context_levels > | tmp_pcc1 = {{1,5,2}} |
boost::array< size_t, PCC2_traits::context_levels > | tmp_pcc2 = {{2,6,1}} |
boost::array< size_t, Hsem_traits::context_levels+1 > | tmp_hsem = {{1,2,2,1}} |
boost::array< size_t, Msem_traits::context_levels+1 > | tmp_msem = {{1,2,1,2,3,1}} |
const Lexicon_db::Key_type | stop_key = "#STOP#" |
const Lexicon_db::Key_type | lf_key = "+UNK+" |
const Lexicon_db::Val_type | stop_code = 0 |
const Nonterminal_db::Key_type | low_freq_key = "+UNK+" |
const Nonterminal_db::Key_type | root_key = "TOP" |
const Nonterminal_db::Val_type | root_code = 2 |
const Semantic_db::Key_type | null_key = "NULL" |
const Semantic_db::Key_type | unknown_key = "<UNK>" |
const int | STEP_CODE = 0 |
Meaning of positions in Proposal tuple. More... | |
const int | ELABORATION = 1 |
const int | SEM_EVENT = 2 |
const int | SYN_EVENT = 3 |
const boost::array < Token_map::Key_type, 2 > | punc = {{",", ":"}} |
const boost::array < Token_map::Key_type, 1 > | base_np = {{"NPB"}} |
const boost::array < Token_map::Key_type, 3 > | unnec = {{".", "''", "``"}} |
const boost::array < Token_map::Key_type, 1 > | coord = {{"CC"}} |
const boost::array < Token_map::Key_type, 2 > | acc_any = {{"UCP", "QP"}} |
typedef Semantic_data<Binary_predicate> semantics::Binary_data |
typedef Nonterminal_elaboration<Binary_predicate> semantics::Binary_elaboration |
typedef Semantic_data<Binary_relation_primitive> semantics::Binary_relation_data |
typedef Semantic_data<Category_primitive> semantics::Category_data |
typedef Semantic_data<Color_primitive> semantics::Color_data |
typedef View_traits<D1_event> semantics::D1_traits |
typedef Event_view<D1_event> semantics::D1_view |
typedef View_traits<D2_event> semantics::D2_traits |
typedef Event_view<D2_event> semantics::D2_view |
Import typedefs from Semantic_step_propsal.
typedef View_traits<Hsem_event> semantics::Hsem_traits |
typedef Event_view<Hsem_event> semantics::Hsem_view |
typedef View_traits<Msem_event> semantics::Msem_traits |
typedef Event_view<Msem_event> semantics::Msem_view |
typedef Semantic_data<Null_primitive> semantics::Null_data |
typedef Terminal_elaboration< Null_primitive > semantics::Null_semantic_terminal |
typedef Semantic_data<Semantic_object> semantics::Object_data |
typedef Nonterminal_elaboration<Semantic_object> semantics::Object_elaboration |
typedef View_traits<PCC1_event> semantics::PCC1_traits |
typedef Event_view<PCC1_event> semantics::PCC1_view |
typedef View_traits<PCC2_event> semantics::PCC2_traits |
typedef Event_view<PCC2_event> semantics::PCC2_view |
typedef std::vector<double> semantics::Probability_array |
typedef View_traits<S1_event> semantics::S1_traits |
typedef Event_view<S1_event> semantics::S1_view |
typedef View_traits<S2_event> semantics::S2_traits |
typedef Event_view<S2_event> semantics::S2_view |
typedef Semantic_data<Size_primitive> semantics::Size_data |
typedef View_traits<U_event> semantics::U_traits |
typedef Event_view<U_event> semantics::U_view |
typedef Semantic_data<Unary_predicate> semantics::Unary_data |
typedef Nonterminal_elaboration<Unary_predicate> semantics::Unary_elaboration |
typedef Semantic_data<Unary_relation_primitive> semantics::Unary_relation_data |
const Symbol_list semantics::accepts_any_coord | ( | acc_any. | begin(), |
acc_any. | end() | ||
) |
const Symbol_list semantics::base_np_labels | ( | base_np. | begin(), |
base_np. | end() | ||
) |
|
inline |
double semantics::calculate_proposal_probability | ( | const Proposal & | proposal, |
const bool & | collins | ||
) |
|
inline |
const Symbol_list semantics::coordination | ( | coord. | begin(), |
coord. | end() | ||
) |
std::string semantics::enum_to_string | ( | Enum_type | ) |
string semantics::enum_to_string< Step_code_t > | ( | Step_code_t | value | ) |
std::string semantics::enum_to_string< Step_code_t > | ( | Step_code_t | ) |
boost::tuple<Proposal_array, Proposal_dist> semantics::generate_all_proposals | ( | const Elab_ptr_const | semantic_parent, |
const Sem_event_ptr | sem_event, | ||
const Syn_event_ptr | syn_event, | ||
const Step_code_t & | curr_step, | ||
const bool & | tree_is_altered, | ||
const bool & | collins | ||
) |
Categorical_event< N > semantics::get_context | ( | const Categorical_event< N > & | event, |
const size_t | steps = 1 |
||
) |
returns RHS of conditioning expression
get RHS of conditioning context
void semantics::initialize_global_semantic_maps | ( | ) |
Key_slots::Map semantics::initialize_map | ( | boost::array< std::string, T::size > | names | ) |
void semantics::initialize_semantic_maps | ( | ) |
read in mappings from files, default config path
void semantics::initialize_semantic_maps | ( | std::string | config_file_path | ) |
read in mappings from files, config file path specified
void semantics::initialize_semantic_maps | ( | const std::map< std::string, std::string > & | config_file_path_map | ) |
read in mappings from files, map with specified data type config paths
void semantics::initialize_special_symbols | ( | ) |
boost::shared_ptr< Object_elaboration > semantics::make_plain_semantic_object | ( | const Object_data::Val_type & | category, |
const Semantic_elaboration::Referent_code & | referent_code | ||
) |
create an object semantic node of category category, no attributes
void semantics::multi_encode | ( | Token_map & | map, |
const T & | keys | ||
) |
U semantics::multi_map_decode | ( | M | maps, |
T | vals | ||
) |
T semantics::multi_map_encode | ( | M | maps, |
U | keys | ||
) |
const boost::shared_ptr< Null_semantic_terminal > & semantics::null_semantic_terminal | ( | ) |
creates a new "null" terminal node (w/ no semantic content)
make a null semantic terminal
std::ostream & semantics::operator<< | ( | std::ostream & | os, |
const Categorical_event_base & | e | ||
) |
display key in human readable form
std::ostream& semantics::operator<< | ( | std::ostream & | os, |
const boost::array< T, D > & | arr | ||
) |
std::ostream & semantics::operator<< | ( | std::ostream & | os, |
Semantic_data_base::Hash_pair | hash_pair | ||
) |
std::ostream & semantics::operator<< | ( | std::ostream & | os, |
Semantic_elaboration::Self_ptr | elab | ||
) |
std::ostream& semantics::operator<< | ( | std::ostream & | os, |
Token_map & | map | ||
) |
std::ostream & semantics::operator<< | ( | std::ostream & | os, |
Semantic_data< T, Traits > | d | ||
) |
std::ostream & semantics::operator<< | ( | std::ostream & | os, |
const typename Marginal_cell< T, N >::Map & | map | ||
) |
std::ostream & semantics::operator<< | ( | std::ostream & | os, |
const typename Marginal_cell< T, 1 >::Map & | map | ||
) |
std::ostream & semantics::operator<< | ( | std::ostream & | os, |
const typename Context_cell< T, N >::Map & | map | ||
) |
std::ostream& semantics::operator<< | ( | std::ostream & | os, |
const std::vector< T > & | c | ||
) |
Event_db semantics::process_event_file | ( | std::string | train_path, |
std::string | lexicon_file, | ||
size_t | max_events, | ||
std::string | test_path | ||
) |
Free_function definitions.
Free functions.
Proposal semantics::propose_a_step | ( | const Elab_ptr_const | semantic_parent, |
const Sem_event_ptr | old_sem_event, | ||
const Syn_event_ptr | old_syn_event, | ||
const Step_code_t | step | ||
) |
boost::tuple< Semspear_tree::Self_ptr, kjb::Vector > semantics::propose_new_tree | ( | const Semspear_tree::Self_ptr | source | ) |
const Symbol_list semantics::punctuation | ( | punc. | begin(), |
punc. | end() | ||
) |
void semantics::resample_all_event_alphas | ( | ) |
void semantics::resample_associations | ( | std::vector< Semspear_tree::Self_ptr > & | trees, |
std::ostream & | results, | ||
const bool & | output_diagnostics | ||
) |
void semantics::resample_event_tables | ( | Semspear_tree::Self_ptr & | source | ) |
void semantics::resample_event_tables | ( | std::vector< Semspear_tree::Self_ptr > & | trees | ) |
void semantics::resample_semspear_trees | ( | std::vector< Semspear_tree::Self_ptr > & | trees, |
const size_t & | iterations, | ||
std::ostream & | results, | ||
const bool & | output_diagnostics | ||
) |
void semantics::set_contingency_table_verbosity | ( | bool | value | ) |
void semantics::set_verbosity | ( | bool | verbose | ) |
Categorical_event< N-1 > semantics::smooth | ( | const Categorical_event< N > & | event, |
const size_t | steps = 1 |
||
) |
marginalizes look-up key by <steps> from back (generalizes context)
get smoothed key (context simplified by one level)
const std::vector< Step_code::Weights > & semantics::step_code_priors | ( | ) |
std::vector<Step_code::Weights> semantics::step_code_priors_by_elaboration_type | ( | ) |
Enum_type semantics::string_to_enum | ( | std::string | ) |
const Symbol_list& semantics::unnecessary_nodes | ( | ) |
const boost::array<Token_map::Key_type, 2> semantics::acc_any = {{"UCP", "QP"}} |
const boost::array<Token_map::Key_type, 1> semantics::base_np = {{"NPB"}} |
const boost::array<Token_map::Key_type, 1> semantics::coord = {{"CC"}} |
const int semantics::ELABORATION = 1 |
const Lexicon_db::Key_type semantics::lf_key = "+UNK+" |
const Nonterminal_db::Key_type semantics::low_freq_key = "+UNK+" |
const Semantic_db::Key_type semantics::null_key = "NULL" |
const boost::array<Token_map::Key_type, 2> semantics::punc = {{",", ":"}} |
const Nonterminal_db::Val_type semantics::root_code = 2 |
const Nonterminal_db::Key_type semantics::root_key = "TOP" |
const int semantics::SEM_EVENT = 2 |
const int semantics::STEP_CODE = 0 |
Meaning of positions in Proposal tuple.
const Lexicon_db::Val_type semantics::stop_code = 0 |
const Nonterminal_db::Key_type semantics::stop_key = "#STOP#" |
const int semantics::SYN_EVENT = 3 |
boost::array<size_t, D1_traits::context_levels> semantics::tmp_d1 = {{3,1,1}} |
boost::array<size_t, D2_traits::context_levels> semantics::tmp_d2 = {{1,7,1}} |
boost::array<size_t, Hsem_traits::context_levels + 1> semantics::tmp_hsem = {{1,2,2,1}} |
boost::array<size_t, Msem_traits::context_levels + 1> semantics::tmp_msem = {{1,2,1,2,3,1}} |
boost::array<size_t, PCC1_traits::context_levels> semantics::tmp_pcc1 = {{1,5,2}} |
boost::array<size_t, PCC2_traits::context_levels> semantics::tmp_pcc2 = {{2,6,1}} |
boost::array<size_t, S1_traits::context_levels> semantics::tmp_s1 = {{1}} |
boost::array<size_t, S2_traits::context_levels> semantics::tmp_s2 = {{1,2}} |
boost::array<size_t, U_traits::context_levels> semantics::tmp_u = {{1,1,1}} |
const Semantic_db::Key_type semantics::unknown_key = "<UNK>" |
const boost::array<Token_map::Key_type, 3> semantics::unnec = {{".", "''", "``"}} |