-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetSummarizeData.py
More file actions
30 lines (25 loc) · 1.29 KB
/
Copy pathgetSummarizeData.py
File metadata and controls
30 lines (25 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
# (C) Copyright 2019-2020, PwC
#
# @brief Summarising the Full content using various algorithms
from framework.summarizeData.contentSummarization import contentSummarization
from framework.commonConstants import *
import pandas as pd
from os.path import join
from config import dataframeWithSummary, dataframeWithContent, encoderURL, rootDir
dfPath = join(rootDir, dataframeWithContent + PKL)
#dfPath = join(rootDir, dataframeWithSummary + PKL)
def getSummarizeData(dfPath, downloadPath, encoderURL, masterDataframeWithSummary):
df = pd.read_pickle(dfPath)
dataObject = contentSummarization(dataframe=df, encoderURL=encoderURL)
df = contentSummarization.writingSummaryIntoDataframe1(dataObject)
df.to_pickle(join(downloadPath, masterDataframeWithSummary + PKL))
df = contentSummarization.writingSummaryIntoDataframe2(dataObject)
dataObject = contentSummarization(dataframe=df, encoderURL=encoderURL)
df = contentSummarization.generatingKeywords(dataObject)
df.to_pickle(join(downloadPath, masterDataframeWithSummary + PKL))
if __name__ == '__main__':
getSummarizeData(dfPath=dfPath,
downloadPath=rootDir,
encoderURL=encoderURL,
masterDataframeWithSummary=dataframeWithSummary)