Skip to content

Commit

Permalink
fix wrong cmd_line parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
liu946 committed Oct 23, 2017
1 parent 48689eb commit 06a2566
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/console/ltp_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ int main(int argc, char *argv[]) {
"The path to the NER model [default=ltp_data/ner.model].")
("parser-model", value<std::string>(),
"The path to the parser model [default=ltp_data/parser.model].")
("srl-data", value<std::string>(),
"The path to the SRL model directory [default=ltp_data/srl_data/].")
("srl-model", value<std::string>(),
"The path to the SRL model [default=ltp_data/pisrl.model].")
("debug-level", value<int>(), "The debug level.")
("help,h", "Show help information");

Expand Down Expand Up @@ -184,13 +184,13 @@ int main(int argc, char *argv[]) {
parser_model= vm["parser-model"].as<std::string>();
}

std::string srl_data= "ltp_data/srl/";
std::string srl_model= "ltp_data/pisrl.model";
if (vm.count("srl-data")) {
srl_data = vm["srl-data"].as<std::string>();
srl_model = vm["srl-data"].as<std::string>();
}

LTP engine(last_stage, segmentor_model, segmentor_lexicon, postagger_model,
postagger_lexcion, ner_model, parser_model, srl_data);
postagger_lexcion, ner_model, parser_model, srl_model);

if (!engine.loaded()) {
std::cerr << "Failed to load LTP" << std::endl;
Expand Down
5 changes: 3 additions & 2 deletions src/console/srl_cmdline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ int main(int argc, char ** argv) {
("input", value<std::string>(), "The path to the input file. "
"Input data should contain one word each line. "
"Sentence should be separated by a blank line. "
"! Note that index start at 0, and index(ROOT)=-1 in the thrid column. "
"(e.g. \"中国 ns 2 ATT\").")
("pisrl-model", value<std::string>(),
"The path to the pi-srl joint model [default=ltp_data/pos.model].")
"The path to the pi-srl joint model [default=ltp_data/pisrl.model].")
("help,h", "Show help information");

if (argc == 1) {
Expand Down Expand Up @@ -130,7 +131,7 @@ int main(int argc, char ** argv) {
std::string input = "";
if (vm.count("input")) { input = vm["input"].as<std::string>(); }

std::string srl_model = "ltp_data/pos.model";
std::string srl_model = "ltp_data/pisrl.model";
if (vm.count("pisrl-model")) {
srl_model = vm["pisrl-model"].as<std::string>();
}
Expand Down

0 comments on commit 06a2566

Please sign in to comment.