Beispiel #1
0
    def insert_mass_data(self, query, query_data):
        """ Make call to insert bulk data"""

        connector = DBConnector('', "SentenceAnalyzer.db")
        conn = connector.create_schema()
        db_cmt = DBManipulation(conn)
        db_cmt.many_insert_query_executor(query, query_data)
Beispiel #2
0
    def insert_mass_data(query, query_data):
        """ Make call to insert bulk data"""

        connector = DBConnector('', "SoftCmpyInfoDB.db")
        conn = connector.create_schema()
        db_cmt = DBManipulation(conn)
        db_cmt.many_insert_query_executor(query, query_data)
Beispiel #3
0
 def pandas_analysis(self):
     connector = DBConnector('', "SentenceAnalyzer.db")
     conn = connector.create_schema()
     if conn != None:
         df = pd.io.sql.read_sql(self.SELECT_ALL_QUERY, conn)
         plt.scatter(x=df['ID'], y=df['sentimentValue'])
         #print df
         #df.plot()
         #df.groupby(['sentiment'])
         #sentiment_sum = df.pivot_table('sentimentValue', rows='sentiment', aggfunc='sum')
         #plt.figure()
         #sentiment_sum.plot(kind='barh', stacked=True, title="Sum of Sentiment value")
         #plt.figure()
         #sentiment_count = df.pivot_table('sentimentValue', rows='sentiment', aggfunc='count')
         #sentiment_count.plot(kind='barh', title="Count of Sentiment in sentence")
         plt.show()
     else:
         raise Exception("The data cant retrieved from SQLITE")
Beispiel #4
0
 def get_all_data(self):
     connector = DBConnector('', "SentenceAnalyzer.db")
     conn = connector.create_schema()
     db_cmt = DBManipulation(conn)
     return db_cmt.select_all_data(self.SELECT_ALL_QUERY)
Beispiel #5
0
 def create_table(self, tableString):
     connector = DBConnector('', "SentenceAnalyzer.db")
     conn = connector.create_schema()
     db_cmt = DBManipulation(conn)
     db_cmt.create_table(tableString)
Beispiel #6
0
 def create_table(tableString):
     connector = DBConnector('', "SoftCmpyInfoDB.db")
     conn = connector.create_schema()
     db_cmt = DBManipulation(conn)
     db_cmt.create_table(tableString)