<jupyter_start><jupyter_text>1. Abstract 2. History 3. Profile 4. Career 5. Captain 6. Offside 7. Style 8. President<jupyter_code>import numpy as np
from doc2vec_gensim import doc2vecs
from LineSplit import LineSplit<jupyter_output><empty_output><jupyter_text>Line Split and Doc2Vec<jupyter_code>data = LineSplit('./Input_SauravGaungly.txt')
limit = 50
doc2vecs(data)<jupyter_output>1000 epochs completed!
Model Saved<jupyter_text>Getting Data Ready<jupyter_code>X = []
len(data)
from gensim.models.doc2vec import Doc2Vec
import numpy as np

model= Doc2Vec.load("d2v.model")

for i in range(0, len(data)): 
    X.append(model.docvecs[str(i)].reshape(10, 10))    

X = np.asarray(X)
X = X.reshape(X.shape[0], X.shape[1], X.shape[2], 1)
print(f"X shape : {X.shape}")<jupyter_output>X shape : (13, 10, 10, 1)<jupyter_text>Predicting classes using CNN<jupyter_code>from keras.models import load_model

model = load_model('CNN_model_sauravGaungly.h5')
classes = model.predict(X)
abstract = []
history = []
profile = []
career = []
captain = []
offside = []
style = []
president = []
for res in range(len(classes)):
    tmp = list(classes[res])
    
    if tmp.index(max(tmp)) == 0:
        abstract.append(data[res])
    elif tmp.index(max(tmp)) == 1:
        history.append(data[res])
    elif tmp.index(max(tmp)) == 2:
        profile.append(data[res])
    elif tmp.index(max(tmp)) == 3:
        career.append(data[res])
    elif tmp.index(max(tmp)) == 4:
        captain.append(data[res])
    elif tmp.index(max(tmp)) == 5:
        offside.append(data[res])
    elif tmp.index(max(tmp)) == 6:
        style.append(data[res])
    elif tmp.index(max(tmp)) == 7:
        president.append(data[res])
Final = [profile,
         career,
         history,
         captain,
         offside,
         style,
         abstract,
         president]

Summary = []
for lis in Final:
    if len(lis) != 0:
        for i in range(0, int(len(lis) * (limit/100))+1):
            Summary.append(lis[i] + ". ")
for line in Summary:
    print(line)
file = open('./summary_sauravGaungly.txt', 'w+', encoding='utf-8')

for line in Summary:
    file.write(line)
file.close()
len(data)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15289821999087175, 'fraction_numerical': 0.02464628023733455, 'mean_word_length': 3.566666666666667, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '539457', 'license': 'MIT', 'n_tokens_mistral': 848, 'n_tokens_neox': 803, 'n_words': 169, 'path': 'Sentence_Classification_Self/Sourav_Gaungly/Prediction and Evaluation - Saurav Gaungly.ipynb', 'repo_name': 'mihirsam/Information-Extraction-using-CNN', 'size': '2191'}