Exemple #1
0
def resume_search(keyword, pageno):       
     if app.config['keyword'] != keyword:
        jids = indexer.searchColl( dataHandler.jobCollection, keyword)    
        jobmodels = dataHandler.get_jobmodel_ids(jids)
        resume = app.config['resume']             
        resumeModel = resumeparser.parseResumeText(resume)           
        result = similarity.match_jobModels(resumeModel , jobmodels) 
        app.config['matchjids'] = result
        print "resume_search len =", len(result)     
         
     result = app.config['matchjids']  
     start = (pageno-1) *20
     end = min ( start+20 , len(result) ) 
     print "resume_search start end " , start , end
     jobpage = result[start:end]    
     jobs=[]
     for key, value in jobpage:         
  #       print  key, value
         job = dataHandler.get_job(key)
         job["score"] = value
         jobs.append(job)                 
             
     pagerInfo = {} 
     resultnum = len(result) 
     pagerInfo["start"] = 1
     pagerInfo["end"]  =  int(math.ceil(float(resultnum) /20))  
     pagerInfo["pageno"] = pageno
     dbinfo["pageno"] = pageno
     dbinfo['collsize'] =  resultnum

  #   return render_template('job_resume_keyword.html', jobs=jobs, keyword=query)     
     return render_template('job_resume_keyword.html', dbinfo=dbinfo, pagerInfo=pagerInfo,  jobs=jobs, query=keyword, qtype="resume_keyword") 
Exemple #2
0
def resume_match(pageno):         
     
     if ( app.config['matchjids'] == None ):  
         print "--- calculate similarity ----"
         resume = app.config['resume']               
         resumeModel = resumeparser.parseResumeText(resume)                              
         modelColl = dataHandler.modelCollection  
         result = similarity.match_jobColl(resumeModel , modelColl  )
         app.config['matchjids'] = result
         print "match len =", len(result)     
     
            
     result = app.config['matchjids']  
     print "resume_match len =", len(result)   
     start = (pageno-1)*20
     end = min ( start+20 , len(result) ) 
     jobpage =  result[start:end]    
     print "resume_match len jobpage =", len(jobpage) , start, end  
     jobs=[]
     for key, value in jobpage:         
  #       print  key, value
         job = dataHandler.get_job(key)
         job["score"] = value
         jobs.append(job)
          
     pagerInfo = {} 
     resultnum = len(result) 
     pagerInfo["start"] = 1
     pagerInfo["end"]  =  int(math.ceil(float(resultnum) /20))  
     pagerInfo["pageno"] = pageno
     dbinfo["pageno"] = pageno
     dbinfo['collsize'] =  resultnum
     return render_template('job_match2.html', dbinfo=dbinfo, pagerInfo=pagerInfo,  jobs=jobs, query="", qtype="resume") 
Exemple #3
0
def upload():
    # Get the name of the uploaded file
    file = request.files['file']
    # Check if the file is one of the allowed types/extensions
    if file and allowed_file(file.filename):
        # Make the filename safe, remove unsupported chars
        filename = secure_filename(file.filename)
        # Move the file form the temporal folder to
        # the upload folder we setup
        path = os.path.join(app.config['UPLOAD_FOLDER'] , filename)
        print "path=", path
        file.save( path )
      #  print "session=", session
        resume = fileToTxt(path)
        session['resume'] = resume
        session['resume_name'] = filename
        app.config['matchjids'] = None 
        app.config['resume'] = resume
        resumeModel = resumeparser.parseResumeText(resume)                              
        app.config['resumeModel'] = resumeModel
        
      #  print  "session resume name ===", resume
                        
        # Redirect the user to the uploaded_file route, which
        # will basicaly show on the browser the uploaded file
        return render_template('set_resume.html', resume=resume, filename=filename )
Exemple #4
0
def upload():
    # Get the name of the uploaded file
    file = request.files['file']
    # Check if the file is one of the allowed types/extensions
    if file and allowed_file(file.filename):
        # Make the filename safe, remove unsupported chars
        filename = secure_filename(file.filename)
        # Move the file form the temporal folder to
        # the upload folder we setup
        path = os.path.join(app.config['UPLOAD_FOLDER'], filename)
        print "path=", path
        file.save(path)
        #  print "session=", session
        resume = fileToTxt(path)
        session['resume'] = resume
        session['resume_name'] = filename
        app.config['matchjids'] = None
        app.config['resume'] = resume
        resumeModel = resumeparser.parseResumeText(resume)
        app.config['resumeModel'] = resumeModel

        #  print  "session resume name ===", resume

        # Redirect the user to the uploaded_file route, which
        # will basicaly show on the browser the uploaded file
        return render_template('set_resume.html',
                               resume=resume,
                               filename=filename)
Exemple #5
0
def getOntology(resumefile, dbname, modelCollName):
    dbClient = DbClient('localhost', 27017, dbname)
    modelColl = dbClient.getCollection(modelCollName)

    with open(resumefile, 'r') as content_file:
        content = content_file.read()
        content = remove_non_ascii_2(content)
    resumeModel = resumeparser.parseResumeText(content)
    # print     resumeModel
    similarity = ModelSimilarity()
    result = similarity.match_jobColl(resumeModel, modelColl)
    n = 1
    for key, value in result[:20]:
        print n, key, value
        n = n + 1
    print "- - - - - - -"
    for key, value in result[:20]:
        print key
Exemple #6
0
def resume_search(keyword, pageno):
    if app.config['keyword'] != keyword:
        jids = indexer.searchColl(dataHandler.jobCollection, keyword)
        jobmodels = dataHandler.get_jobmodel_ids(jids)
        resume = app.config['resume']
        resumeModel = resumeparser.parseResumeText(resume)
        result = similarity.match_jobModels(resumeModel, jobmodels)
        app.config['matchjids'] = result
        print "resume_search len =", len(result)

    result = app.config['matchjids']
    start = (pageno - 1) * 20
    end = min(start + 20, len(result))
    print "resume_search start end ", start, end
    jobpage = result[start:end]
    jobs = []
    for key, value in jobpage:
        #       print  key, value
        job = dataHandler.get_job(key)
        job["score"] = value
        jobs.append(job)

    pagerInfo = {}
    resultnum = len(result)
    pagerInfo["start"] = 1
    pagerInfo["end"] = int(math.ceil(float(resultnum) / 20))
    pagerInfo["pageno"] = pageno
    dbinfo["pageno"] = pageno
    dbinfo['collsize'] = resultnum

    #   return render_template('job_resume_keyword.html', jobs=jobs, keyword=query)
    return render_template('job_resume_keyword.html',
                           dbinfo=dbinfo,
                           pagerInfo=pagerInfo,
                           jobs=jobs,
                           query=keyword,
                           qtype="resume_keyword")
Exemple #7
0
def resume_match(pageno):

    if (app.config['matchjids'] == None):
        print "--- calculate similarity ----"
        resume = app.config['resume']
        resumeModel = resumeparser.parseResumeText(resume)
        modelColl = dataHandler.modelCollection
        result = similarity.match_jobColl(resumeModel, modelColl)
        app.config['matchjids'] = result
        print "match len =", len(result)

    result = app.config['matchjids']
    print "resume_match len =", len(result)
    start = (pageno - 1) * 20
    end = min(start + 20, len(result))
    jobpage = result[start:end]
    print "resume_match len jobpage =", len(jobpage), start, end
    jobs = []
    for key, value in jobpage:
        #       print  key, value
        job = dataHandler.get_job(key)
        job["score"] = value
        jobs.append(job)

    pagerInfo = {}
    resultnum = len(result)
    pagerInfo["start"] = 1
    pagerInfo["end"] = int(math.ceil(float(resultnum) / 20))
    pagerInfo["pageno"] = pageno
    dbinfo["pageno"] = pageno
    dbinfo['collsize'] = resultnum
    return render_template('job_match2.html',
                           dbinfo=dbinfo,
                           pagerInfo=pagerInfo,
                           jobs=jobs,
                           query="",
                           qtype="resume")