Exemplo n.º 1
0
def recommend():
    resume = request.form.get('resume', None)
    requirements = request.form.get('requirements', None)
    # Initialize recommender
    recommender = Recommender(ngram_range=(1, 1),
                              use_tagger=True,
                              use_stem=False)
    recommender.fit(resume, requirements)
    # Requirement pair: [0] original requirement: [1]Extracted requirement
    missing_requirement_pairs = recommender.find_missing_skills()
    missing_requirements = [item[1] for item in missing_requirement_pairs]
    course_recommedations = recommender.recommend()
    if len(missing_requirements) > 0:
        return render_template('recommend.html',
                               data=zip(missing_requirements,
                                        course_recommedations))
    return render_template('matchall.html')
Exemplo n.º 2
0
def get_recommendations(resume_file,
                        requirement_file,
                        ngram_range=(1, 1),
                        use_tagger=False,
                        use_stem=False):
    with open(resume_file, 'r') as handle:
        resume = handle.read()
    with open(requirement_file, 'r') as handle:
        requirements = handle.read()
    recommender = Recommender(ngram_range=ngram_range,
                              use_tagger=use_tagger,
                              use_stem=use_stem)
    recommender.fit(resume, requirements)
    missing_requirements = recommender.find_missing_skills()
    print "Requirements:"
    print recommender.requirements
    print "preprocessed_requirements:"
    print recommender.preprocessed_requirements
    print "recommender.missing_requirements"
    print recommender.missing_requirements
    course_recommedations = recommender.recommend()
    return missing_requirements, course_recommedations