We shall add a function that builds an index according to the tf-idf score. To this end, we shall:
get the number of stems in a model, and store them in a first version of the index.
Currently this might be sufficient for our implementation. If more than one term of the query occur in the model this model shall be always ranked higher than models where only one term occurs very often. However, we could also keep the stems separated and rank the models only according to the frequency of the term.
when the index is completed we shall compute the idf value
update the first version of the index with the tf-idf value
Then we can be able to rank the models according to the frequency of the searched terms. The ranking shall be given according to a combination of the tf-idf of all the stems.
We shall add a function that builds an index according to the tf-idf score. To this end, we shall:
Currently this might be sufficient for our implementation. If more than one term of the query occur in the model this model shall be always ranked higher than models where only one term occurs very often. However, we could also keep the stems separated and rank the models only according to the frequency of the term.