Skip to content

Instantly share code, notes, and snippets.

View mkhorasani's full-sized avatar

Mohammad Khorasani mkhorasani

View GitHub Profile
def keyphrases(file,min_word,max_word,num_phrases):
text = file
text = text.lower()
text = ''.join(s for s in text if ord(s)>31 and ord(s)<126)
text = text
text = re.sub(' +', ' ', text)
text = text.translate(str.maketrans('', '',string.punctuation))
text = ''.join([i for i in text if not i.isdigit()])
r = Rake(min_length = min_word, max_length = max_word)
country = st.sidebar.text_input('Country')
uploaded_file = st.file_uploader('Upload your resume')
file_text = ''
phrases = []
if uploaded_file is not None:
uploaded_file.seek(0)
file = uploaded_file.read()
pdf = PyPDF2.PdfFileReader(io.BytesIO(file))
import streamlit as st
import pymongo
from pymongo import MongoClient
import pandas as pd
import pdfplumber
import PyPDF2
from rake_nltk import Rake
import string
import io
import re
client = pymongo.MongoClient("mongodb+srv://test:<password>@cluster0.nq0me.mongodb.net/<dbname>?retryWrites=true&w=majority")
def query(country,keywords):
result = client['database1']['collection1'].aggregate([
{
'$search': {
'text': {
'path': [
'industry'
mkdir -p ~/.streamlit/
echo "\
[server]\n\
headless = true\n\
port = $PORT\n\
enableCORS = false\n\
\n\
" > ~/.streamlit/config.toml
web: sh setup.sh && streamlit run jobmatch.py
import streamlit as st
import pandas as pd
import psycopg2
from sqlalchemy import create_engine
from streamlit.report_thread import get_report_ctx
def get_session_id():
session_id = get_report_ctx().session_id
session_id = session_id.replace('-','_')
session_id = '_id_' + session_id
return session_id
if __name__ == '__main__':
#Creating PostgreSQL client
engine = create_engine('postgresql://<username>:<password>@localhost:5432/<database name>')
#Getting session ID
session_id = get_session_id()
#Creating session state tables
engine.execute("CREATE TABLE IF NOT EXISTS %s (size text)" % (session_id))