More explaination about <s> error

This commit is contained in:
Kenneth Heafield 2011-12-01 13:21:55 +00:00
parent 7ee2d064b8
commit 10c1e9ec2e
2 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@ void LanguageModelImplementation::CalcScore(const Phrase &phrase, float &fullSco
if (word == GetSentenceStartArray()) {
// do nothing, don't include prob for <s> unigram
if (currPos != 0) {
std::cerr << "Your data contains <s> in a position other than the first word." << std::endl;
std::cerr << "Either your data contains <s> in a position other than the first word or your language model is missing <s>. Did you build your ARPA using IRSTLM and forget to run add-start-end.sh?" << std::endl;
abort();
}
} else {

View File

@ -198,7 +198,7 @@ template <class Model> void LanguageModelKen<Model>::CalcScore(const Phrase &phr
} else {
lm::WordIndex index = TranslateID(word);
if (index == m_ngram->GetVocabulary().BeginSentence()) {
std::cerr << "Your data contains <s> in a position other than the first word." << std::endl;
std::cerr << "Either your data contains <s> in a position other than the first word or your language model is missing <s>. Did you build your ARPA using IRSTLM and forget to run add-start-end.sh?" << std::endl;
abort();
}
float score = TransformLMScore(m_ngram->Score(*state0, index, *state1));