Open slava-vishnyakov opened 6 years ago
One thing that might be is that it should be returning $p_t_d
instead of $p
, but that has no useful information either..
$p_t_d is
array:2 [▼
0 => array:4 [
0 => 0.33333333333333
1 => 0.33333333333333
2 => 0.33333333333333
3 => 0.33333333333333
]
1 => & array:4 [
0 => 0.33333333333333
1 => 0.33333333333333
2 => 0.33333333333333
3 => 0.33333333333333
]
]
Ok, maybe I have figured this out in PR #67
I'm trying to follow http://php-nlp-tools.com/posts/introducing-latent-dirichlet-allocation.html But trying to call
getDocumentsPerTopicsProbabilities
at the end:This results in:
Undefined offset: 0 at vendor/nlp-tools/nlp-tools/src/NlpTools/Models/Lda.php:243
This probably requires something along the lines of:
also, further down you have a variable
$limit_docs
, which is undefined, maybe the signature of method is incorrectpublic function getDocumentsPerTopicsProbabilities($limit_docs = -1)
, maybe it's$limit_words
there?But, anyways, after running this method on this input:
I get this result:
And I'm not sure how to interpret that... :)
Thanks!