def recommend(top, similar, users):
    """ Invoke script responsible for generating recommendations.
    """
    from listenbrainz_spark.recommendations import recommend
    with app.app_context():
        _ = recommend.main(recommendation_top_artist_limit=top,
                           recommendation_similar_artist_limit=similar,
                           users=users)
def recommend():
    """ Invoke script responsible for generating recommendations.
    """
    from listenbrainz_spark.recommendations import recommend
    with app.app_context():
        recommend.main()
Пример #3
0
import sys
import logging

from listenbrainz_spark.stats import user
from listenbrainz_spark.recommendations import create_dataframes
from listenbrainz_spark.recommendations import train_models
from listenbrainz_spark.recommendations import recommend

if __name__ == '__main__':
    if len(sys.argv) != 2:
        print("Usage: manage.py <module_name>")
        sys.exit(-1)

    # The root logger always defaults to WARNING level
    # The level is changed from WARNING to INFO
    logging.getLogger().setLevel(logging.INFO)

    module_name = sys.argv[1]
    if module_name == 'create_dataframes':
        create_dataframes.main()
    elif module_name == 'train_models':
        train_models.main()
    elif module_name == 'recommend':
        recommend.main()
    elif module_name == 'user':
        user.main()