Sudhanshu976 commited on
Commit
fe5faf3
β€’
1 Parent(s): 3c1815a
language-detector-models/model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:279792554b0bc74e77f1bdab5b46c9962ce026ef56a814e7da0bb9edb7911545
3
+ size 2176914
language-detector-models/vectorizer.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc63d514d2c6cf98e7a5c44f6edcab0189be7195878bb87ba7a23015746a1209
3
+ size 517916
pages/2_πŸ“ž_CONTACT.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ st.set_page_config(
3
+ page_title="NLP WEB APP"
4
+ )
5
+
6
+ def local_css(file_name):
7
+ with open(file_name) as f:
8
+ st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
9
+
10
+ local_css("style/style.css")
11
+
12
+
13
+ st.title("CONTACT US")
14
+ st.sidebar.success("Select a page above")
15
+
16
+ with st.container():
17
+ st.write("-----")
18
+ st.header("Get in Touch with Me !")
19
+ st.write("##")
20
+
21
+ contact_form="""
22
+
23
+ <form action="https://formsubmit.co/cus146126@gmail.com" method="POST">
24
+ <input type="hidden" name="_captcha" value="false">
25
+ <input type="text" name="name" placeholder="Your name" required>
26
+ <input type="email" name="email" placeholder="Your email" required>
27
+ <textarea name="message" placeholder="Your message here ... " required></textarea>
28
+
29
+ <button type="submit">Send</button>
30
+ </form>
31
+
32
+ """
33
+
34
+ left_col , right_col = st.columns(2)
35
+ with left_col:
36
+ st.markdown(contact_form, unsafe_allow_html=True)
37
+ with right_col:
38
+ st.empty()
pages/3_πŸ™Ž_RESUME.py ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+
3
+ import streamlit as st
4
+ from PIL import Image
5
+ st.set_page_config(
6
+ page_title="NLP WEB APP"
7
+ )
8
+
9
+
10
+ # --- PATH SETTINGS ---
11
+ current_dir = Path(__file__).parent if "__file__" in locals() else Path.cwd()
12
+ css_file = current_dir / "styles" / "main.css"
13
+ resume_file = current_dir / "assets" / "my_resume.pdf"
14
+ profile_pic = current_dir / "assets" / "profile-pic.png"
15
+
16
+
17
+ # --- GENERAL SETTINGS ---
18
+ PAGE_TITLE = "Digital CV | John Doe"
19
+ PAGE_ICON = ":wave:"
20
+ NAME = "SUDHANSHU"
21
+ DESCRIPTION = """
22
+ Aspiring Data Scientist | 18-Year-Old Data Enthusiast | 1 Year of Hands-On Experience | Passionate about Solving Real-World Problems"
23
+ """
24
+ EMAIL = "gusainsudhanshu43@gmail.com"
25
+ SOCIAL_MEDIA = {
26
+ "YouTube": "https://youtube.com/",
27
+ "LinkedIn": "https://www.linkedin.com/in/sudhanshu-gusain-34271028a/",
28
+ "GitHub": "https://github.com/sudhanshu976",
29
+ "Twitter": "https://twitter.com",
30
+ }
31
+ PROJECTS = {
32
+ "πŸ† POWER-BI Dashboards - Making interactive and dynamic dashboards": "https://github.com/sudhanshu976/POWER-BI-PROJECTS",
33
+ "πŸ† Potato Disease Classifier using CNN - Checks whether a given potato leaf is healthy , early-blight or late-blight": "https://github.com/sudhanshu976/POTATO-DISEASE-CLASSIFIER-WITH-DEPLOYMENT",
34
+ "πŸ† Combined NLP WEB APP - This web app contains all NLP Projects I have made till date ": "https://github.com/sudhanshu976/NLP_FULL",
35
+ }
36
+
37
+
38
+
39
+
40
+ # --- LOAD CSS, PDF & PROFIL PIC ---
41
+ with open(css_file) as f:
42
+ st.markdown("<style>{}</style>".format(f.read()), unsafe_allow_html=True)
43
+ with open(resume_file, "rb") as pdf_file:
44
+ PDFbyte = pdf_file.read()
45
+ profile_pic = Image.open(profile_pic)
46
+
47
+
48
+ # --- HERO SECTION ---
49
+ col1, col2 = st.columns(2, gap="small")
50
+ with col1:
51
+ st.image(profile_pic, width=230)
52
+
53
+ with col2:
54
+ st.title(NAME)
55
+ st.write(DESCRIPTION)
56
+ st.download_button(
57
+ label=" πŸ“„ Download Resume",
58
+ data=PDFbyte,
59
+ file_name=resume_file.name,
60
+ mime="application/octet-stream",
61
+ )
62
+ st.write("πŸ“«", EMAIL)
63
+
64
+
65
+ # --- SOCIAL LINKS ---
66
+ st.write('\n')
67
+ cols = st.columns(len(SOCIAL_MEDIA))
68
+ for index, (platform, link) in enumerate(SOCIAL_MEDIA.items()):
69
+ cols[index].write(f"[{platform}]({link})")
70
+
71
+
72
+ # --- EXPERIENCE & QUALIFICATIONS ---
73
+ st.write('\n')
74
+ st.subheader("Experience & Qulifications")
75
+ st.write(
76
+ """
77
+ - βœ”οΈ 1 Year expereince of performing various Data Science and NLP tasks
78
+ - βœ”οΈ Strong hands on experience and knowledge in Python , ML , DL and NLP
79
+ - βœ”οΈ Good understanding of statistical principles and their respective applications
80
+ - βœ”οΈ Excellent team-player and displaying strong sense of initiative on tasks
81
+ """
82
+ )
83
+
84
+
85
+ # --- SKILLS ---
86
+ st.write('\n')
87
+ st.subheader("Hard Skills")
88
+ st.write(
89
+ """
90
+ - πŸ‘©β€πŸ’» Programming: Python (Scikit-learn, Pandas , Numpy , Pytorch , Tensorflow)
91
+ - πŸ“Š Data Visulization: PowerBi, Matplotlib , Seaborn
92
+ - πŸ“š Modeling: Supervised and Unsupervised ML algorithms , ANN , RNN , CNN
93
+ - πŸ—„οΈ Databases: MySQL
94
+ - πŸ—„οΈ WEB DEPLOYMENT: FLASK , Streamlit , Heroku
95
+ """
96
+ )
97
+
98
+
99
+ # --- WORK HISTORY ---
100
+ st.write('\n')
101
+ st.subheader("Work History")
102
+ st.write("---")
103
+
104
+ # --- JOB 1
105
+ st.write("🚧", "**Freelancer Data Scientist and NLP Engineer**")
106
+ st.write("05/2023 - Present")
107
+ st.write(
108
+ """
109
+ - β–Ί Used PowerBI for creating interactive dashboards
110
+ - β–Ί Solved many ML , DL and NLP problems in various fields like medical , agriculture , etc
111
+ - β–Ί Well versed in solving real life problems especially using NLP
112
+ """
113
+ )
114
+
115
+ # --- Projects & Accomplishments ---
116
+ st.write('\n')
117
+ st.subheader("Projects & Accomplishments")
118
+ st.write("---")
119
+ for project, link in PROJECTS.items():
120
+ st.write(f"[{project}]({link})")
pages/4_LANGUAGE-DETECTOR-MODEL.py ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pickle
3
+ import re
4
+ import string
5
+ import nltk
6
+ from nltk.corpus import stopwords
7
+ from nltk.tokenize import word_tokenize
8
+ from nltk.stem.porter import PorterStemmer
9
+ stemmer = PorterStemmer()
10
+
11
+ st.set_page_config(
12
+ page_title="NLP WEB APP"
13
+ )
14
+
15
+ st.title("LANGUAGE DETECTOR MODEL")
16
+ st.sidebar.success("Select a page above")
17
+ nltk.download('stopwords')
18
+ nltk.download('punkt')
19
+
20
+ def preprocess(text):
21
+ text = text.lower()
22
+ text = re.sub(r'\d+', '', text)
23
+ translator = str.maketrans('', '', string.punctuation)
24
+ text = text.translate(translator)
25
+
26
+
27
+ stop_words = set(stopwords.words("english"))
28
+ word_tokens = word_tokenize(text)
29
+ filtered_text = [word for word in word_tokens if word not in stop_words]
30
+
31
+ stems = [stemmer.stem(word) for word in filtered_text]
32
+ preprocessed_text = ' '.join(stems)
33
+ return preprocessed_text
34
+
35
+
36
+
37
+ cv = pickle.load(open('language-detector-models/vectorizer.pkl','rb'))
38
+ model = pickle.load(open('language-detector-models/model.pkl','rb'))
39
+
40
+ message= st.text_input("ENTER THE MESSAGE")
41
+
42
+
43
+ if st.button("PREDICT"):
44
+ # PREPROCESS
45
+ transformed_text = preprocess(message)
46
+
47
+ # VECTORIZE
48
+ vector_input = cv.transform([message])
49
+
50
+ # PREDICTION
51
+ result = model.predict(vector_input)[0]
52
+
53
+
54
+ # DISPLAY
55
+ if result==0:
56
+ st.header("ARABIC")
57
+ elif result==1:
58
+ st.header("DANISH")
59
+ elif result==2:
60
+ st.header("DUTCH")
61
+ elif result==3:
62
+ st.header("ENGLISH")
63
+ elif result==4:
64
+ st.header("FRENCH")
65
+ elif result==5:
66
+ st.header("GERMAN")
67
+ elif result==6:
68
+ st.header("GREEK")
69
+ elif result==7:
70
+ st.header("HINDI")
71
+ elif result==8:
72
+ st.header("ITALIAN")
73
+ elif result==9:
74
+ st.header("KANNADA")
75
+ elif result==10:
76
+ st.header("MALYALAM")
77
+ elif result==11:
78
+ st.header("PORTUGESE")
79
+ elif result==12:
80
+ st.header("RUSSIAN")
81
+ elif result==13:
82
+ st.header("SPANISH")
83
+ elif result==14:
84
+ st.header("SWEDISH")
85
+ elif result==15:
86
+ st.header("TAMIL")
87
+ else:
88
+ st.header("TURKISH")
pages/5_SENTIMENT-ANALYZER.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import AutoTokenizer , AutoModelForSequenceClassification
3
+ import torch
4
+
5
+
6
+ tokenizer = AutoTokenizer.from_pretrained('nlptown/bert-base-multilingual-uncased-sentiment')
7
+ model = AutoModelForSequenceClassification.from_pretrained('nlptown/bert-base-multilingual-uncased-sentiment')
8
+
9
+ st.set_page_config(
10
+ page_title="NLP WEB APP"
11
+ )
12
+
13
+
14
+ st.title("SENTIMENT ANALYZER")
15
+ st.sidebar.success("Select a page above")
16
+
17
+
18
+ message= st.text_input("ENTER THE MESSAGE")
19
+
20
+ if st.button("PREDICT"):
21
+ tokens = tokenizer.encode(message , return_tensors='pt')
22
+ output = model(tokens)
23
+ result = int(torch.argmax(output.logits))+1
24
+
25
+
26
+ if result==1:
27
+ st.header("TOO MUCH NEGATIVE STATEMENT")
28
+ st.header("RATING : ⭐ ")
29
+ elif result==2:
30
+ st.header("NEGATIVE STATEMENT")
31
+ st.header("RATING : ⭐⭐")
32
+ elif result==3:
33
+ st.header("NEUTRAL STATEMENT")
34
+ st.header("RATING : ⭐⭐⭐")
35
+ elif result==4:
36
+ st.header("POSITIVE STATEMENT")
37
+ st.header("RATING : ⭐⭐⭐⭐ ")
38
+ elif result==5:
39
+ st.header("TOO MUCH POSITIVE STATEMENT")
40
+ st.header("RATING : ⭐⭐⭐⭐⭐ ")
pages/6_SMS-SPAM-CLASSIFIER.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ st.set_page_config(
4
+ page_title="NLP WEB APP"
5
+ )
6
+
7
+ st.title("SMS SPAM CLASSIFIER")
8
+ st.sidebar.success("Select a page above")
9
+
10
+
11
+
12
+ import pickle
13
+ import string
14
+
15
+ from nltk.corpus import stopwords
16
+ import nltk
17
+ nltk.download('punkt')
18
+ nltk.download('stopwords')
19
+
20
+ from nltk.stem.porter import PorterStemmer
21
+ ps = PorterStemmer()
22
+
23
+ def transform_text(text):
24
+ # Lowering
25
+ text = text.lower()
26
+
27
+ #Tokenizing
28
+ text = nltk.word_tokenize(text)
29
+
30
+ #Removing special characters
31
+ new_text=[]
32
+ for word in text:
33
+ if word.isalnum():
34
+ new_text.append(word)
35
+
36
+ text = new_text[:]
37
+ new_text.clear()
38
+
39
+ #Removing stopwords and punctuation
40
+ for word in text:
41
+ if word not in stopwords.words('english') and word not in string.punctuation:
42
+ new_text.append(word)
43
+
44
+
45
+ text = new_text[:]
46
+ new_text.clear()
47
+
48
+ # Stemming
49
+ for word in text :
50
+ new_text.append(ps.stem(word))
51
+
52
+ return " ".join(new_text)
53
+
54
+ tfidf = pickle.load(open('sms-spam-models/vectorizer.pkl','rb'))
55
+ model = pickle.load(open('sms-spam-models/model.pkl','rb'))
56
+
57
+ sms = st.text_input("ENTER THE MESSAGE")
58
+
59
+ if st.button("PREDICT"):
60
+ # PREPROCESS
61
+ transformed_sms = transform_text(sms)
62
+
63
+ # VECTORIZE
64
+ vector_input = tfidf.transform([transformed_sms])
65
+
66
+ # PREDICTION
67
+ result = model.predict(vector_input)[0]
68
+
69
+
70
+ # DISPLAY
71
+
72
+ if result==1:
73
+ st.header("SPAM")
74
+ else:
75
+ st.header("NOT SPAM")
pages/7_NEXT_WORD_PREDICTOR.py ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import numpy as np
3
+
4
+
5
+ st.set_page_config(
6
+ page_title="NLP WEB APP"
7
+ )
8
+
9
+ st.title("NEXT WORD PREDICTOR")
10
+ st.sidebar.success("Select a page above")
11
+
12
+
13
+ string1 = st.text_area("Enter the training text (Note : This may take time depending upon the data size )")
14
+
15
+
16
+
17
+ test = st.text_input("ENTER THE WORD")
18
+ number = st.number_input("Enter the number of next words" )
19
+ number = int(number)
20
+
21
+
22
+ import tensorflow as tf
23
+ import numpy as np
24
+ from tensorflow.keras.preprocessing.text import Tokenizer
25
+ from tensorflow.keras.preprocessing.sequence import pad_sequences
26
+ from tensorflow.keras.utils import to_categorical
27
+ from tensorflow.keras.models import Sequential
28
+ from tensorflow.keras.layers import Embedding,Dense,LSTM
29
+
30
+ if st.button("PREDICT"):
31
+ tokenizer = Tokenizer()
32
+ tokenizer.fit_on_texts([string1])
33
+
34
+ input_sequences =[]
35
+ for sentence in string1.split("\n"):
36
+ tokenized_sentences = tokenizer.texts_to_sequences([sentence])[0]
37
+
38
+ for i in range(1,len(tokenized_sentences)):
39
+ input_sequences.append(tokenized_sentences[:i+1])
40
+
41
+
42
+ max_len = max([len(x) for x in input_sequences])
43
+
44
+ padded_input_sentences = pad_sequences(input_sequences , maxlen = max_len , padding ="pre")
45
+ X = padded_input_sentences[:,:-1]
46
+ Y = padded_input_sentences[:,-1]
47
+ num_class = len(tokenizer.word_index)
48
+ Y = to_categorical(Y , num_classes=num_class+1)
49
+
50
+
51
+
52
+ model = Sequential()
53
+ model.add(Embedding(num_class+1,100,input_shape = (X.shape[1],)))
54
+
55
+ model.add(LSTM(250))
56
+
57
+ model.add(Dense(num_class+1,activation ="softmax"))
58
+
59
+ model.compile(loss="categorical_crossentropy" , optimizer="adam" , metrics=["accuracy"])
60
+
61
+
62
+ model.fit(X,Y,epochs=100)
63
+
64
+ for i in range(number):
65
+
66
+
67
+ output_token = tokenizer.texts_to_sequences([test])[0]
68
+ padded_token = pad_sequences([output_token] , maxlen=max_len,padding="pre")
69
+ output = np.argmax(model.predict(padded_token))
70
+ for word,index in tokenizer.word_index.items():
71
+ if index == output:
72
+ test =test + " " + word
73
+
74
+ st.header(test)
pages/assets/my_resume.pdf ADDED
Binary file (68.3 kB). View file
 
pages/assets/profile-pic.png ADDED
pages/styles/main.css ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import url('https://fonts.googleapis.com/css2?family=Readex+Pro:wght@300;400;500;600;700&display=swap');
2
+
3
+
4
+ * {font-family: 'Readex Pro';}
5
+
6
+
7
+ a {
8
+ text-decoration: none;
9
+ color: white !important;
10
+ font-weight: 500;
11
+ }
12
+
13
+ a:hover {
14
+ color: #d33682 !important;
15
+ text-decoration: none;
16
+ }
17
+
18
+ ul {list-style-type: none;}
19
+
20
+ hr {
21
+ margin-top: 0px;
22
+ margin-bottom: 5%;
23
+ }
24
+
25
+ #MainMenu {visibility: hidden;}
26
+ footer {visibility: hidden;}
27
+ header {visibility: hidden;}
sms-spam-models/model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:208d6e1dcb73e5cdaf76e165c69821004bed116c25080eae843df1f4092c138c
3
+ size 96605
sms-spam-models/vectorizer.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6acf5b90ca6f2a5cd6c978ff7101a497849b20bba64844028da4cc0d337ebf01
3
+ size 160670
style/style.css ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSS Snippet from W3schools: https://www.w3schools.com/howto/howto_css_contact_form.asp */
2
+ /* Style inputs with type="text", select elements and textareas */
3
+ input[type=message], input[type=email], input[type=text], textarea {
4
+ width: 100%; /* Full width */
5
+ padding: 12px; /* Some padding */
6
+ border: 1px solid #ccc; /* Gray border */
7
+ border-radius: 4px; /* Rounded borders */
8
+ box-sizing: border-box; /* Make sure that padding and width stays in place */
9
+ margin-top: 6px; /* Add a top margin */
10
+ margin-bottom: 16px; /* Bottom margin */
11
+ resize: vertical /* Allow the user to vertically resize the textarea (not horizontally) */
12
+ }
13
+
14
+ /* Style the submit button with a specific background color etc */
15
+ button[type=submit] {
16
+ background-color: #04AA6D;
17
+ color: white;
18
+ padding: 12px 20px;
19
+ border: none;
20
+ border-radius: 4px;
21
+ cursor: pointer;
22
+ }
23
+
24
+ /* When moving the mouse over the submit button, add a darker green color */
25
+ button[type=submit]:hover {
26
+ background-color: #45a049;
27
+ }
28
+
29
+
30
+ /* Hide Streamlit Branding */
31
+ #MainMenu {visibility: hidden;}
32
+ footer {visibility: hidden;}
33
+ header {visibility: hidden;}