微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 PyMyPDF 通过 Python 从简历中提取 GPA

如何解决使用 PyMyPDF 通过 Python 从简历中提取 GPA

我们为简单的简历制作了一个程序,它可以逐行提取字符串中的整个简历信息。现在我想从该字符串中提取 GPA。我尝试了很多,但对此一无所知。所以如果有人可以配置这对我来说非常有帮助。

LC_ALL=C ocsigen-i18n-generator \
--languages en,fr \
--default-language en \
--primary myapp_i18n.tsv \
< assets/myapp_Demo_i18n.tsv \
> myapp_Demo_i18n.eliom
eliomc -w +A-4-7-9-37-38-39-41-42-44-45-48 -ppx -ppx "ocsigen-i18n-rewriter --prefix 'Myapp_' --suffix '_i18n' Myapp_i18n" -infer -package lwt_ppx -package js_of_ocaml-ppx_deriving_json -package ppx_deriving.std -package pgocaml -package ocsigen-start.server myapp_Demo_i18n.eliom
File "myapp_Demo_i18n.eliom",line 1,characters 24-37:
1 | let%shared languages = [Myapp_i18n.En;Myapp_i18n.Fr]
                            ^^^^^^^^^^^^^
Error: Unbound constructor Myapp_i18n.En
make: *** [Makefile.os:213: _server/myapp_Demo_i18n.type_mli] Error 2
rm myapp_Demo_i18n.eliom

这段代码输出

import fitz
import os

pdfFiles = []
for filename in os.listdir('resume/'):
    if filename.endswith('.pdf'):
        print(filename)
        os.chdir('C:/Users/M. Abrar Hussain/Desktop/cv/resume')
        pdfFileObj = open(filename,'rb')
        with fitz.open(pdfFileObj) as doc:
            text = ""
            for page in doc:
                text += page.getText()
            print(text)
            p = doc.loadPage(0)
            p_text = p.getText()
            p_lines = p_text.splitlines()
            print(p_lines)
            search_keywords = ['Laravel','Java','Python']
            # Comparing data with keywords
            lst = []
            for sentence in p_lines:
                for word in search_keywords:
                    if word in sentence:
                        lst.append(word)
            print(lst)

            score = 0
            w1 = []

            for w1 in lst:
                if w1 == 'Laravel':
                    score = score + 2
                if w1 == 'Python':
                    score = score + 2
                if w1 == 'Java':
                    score = score + 1

            print("The candidate has score = %i" % score)
            print('\n')
        pdfFileObj.close()

在此输出中,我们能够将技能与关键字进行比较并给它们评分。现在我们的主要重点是从字符串中提取 GPA 值并在比较后给出分数,就像我们之前对技能所做的那样

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。