def __init__(self):
     self.config = {
         'user': '******',
         'password': '******',
         'host': 'mthx.cafe24.com',
         'database': 'chatbot',
         'raise_on_warnings': True
     }
     self.db = dbConMysql(self.config)
Esempio n. 2
0
 def __init__(
         self,
         incTags=['NN', 'NR', 'NP', 'VA', 'VV', 'SF', "MA", "MD", "XS"],
         dbConfig={
             'user': '******',
             'password': '******',
             'host': 'mthx.cafe24.com',
             'database': 'chatbot',
             'raise_on_warnings': True
         },
         isLogOut=True):
     self.isLogOut = isLogOut
     if (self.isLogOut): print("[Chatbot mod] created")
     self.lIncTags = incTags
     self.db_config = dbConfig
     self.db = dbConMysql(self.db_config)
     if (self.isLogOut): print("[Chatbot mod] db is created.")
     self.komohelper = komoHelper()
     self.komohelper.UpdateTextFile("userDict.txt")
     self.komoran = Komoran()
     self.komoran.set_user_dictionary("userDict.txt")
     self.state = 0
 def openDB(self, dbInfo):
     self.db = dbConMysql(dbInfo)
 def __init__ ( self, contentID ) :
     self.db = dbConMysql()
komohelper = komoHelper()
komoran = Komoran()

# Include Tag lists
listIncTag = ['NN','NR','NP','VA','VV','SF',"MA","MD","XS"]

config =  {
          'user': '******',
          'password': '******',
          'host': 'mthx.cafe24.com',
          'database': 'chatbot',
          'raise_on_warnings': True
}

db = dbConMysql( config )
dlg_ret = db.selectQuery( "select * from tDlgTest" )

#print(  dlg_ret[0]['reply'] )
#exit(0)

# 학습하려면 pandas가 있어야 되는 듯한 느낌이다. vector 처리할 거니까..
# 나중엔 다른 방법으로도 할 수 있지만. 일단은 pandas에 써볼까?

# create pandas
df_dlg = pd.DataFrame( dlg_ret )

print( df_dlg )
nShape = df_dlg.shape[0]
print( nShape )
listTokens_s = []