skfasttext/FastTextClassifier.py
def predict_proba(self,test_file,csvflag=True,k_best=1):
                '''
                Input: List of sentences
                return reort of classification
                to do: check output of classifier predct_proba add label option and unit testing
                '''
                try:
                    if csvflag==False and type(test_file) == 'list':
                        self.result=self.classifier.predict_proba(test_file,k=k_best)
                    if csvflag:
                            lines=open(test_file,"r").readlines()
                            sentences=[line.split(" , ")[1] for line in lines]
                            self.result=self.classifier.predict_proba(sentences,k_best)
                except:
                    print("Error in input dataset.. please see if the file/list of sentences is of correct format")
                    sys.exit(-1)
                return(self.result)

                Input: List of sentences
                return reort of classification
                to do: check output of classifier predct_proba add label option and unit testing
                
List of sentences
return reort of classification
to do: check output of classifier predct_proba add label option and unit testing
List of sentences return reort of classification to do : check output of classifier predct_proba add label option and unit testing
def predict_proba(self,test_file,csvflag=True,k_best=1):
                try:
                    if csvflag==False and type(test_file) == 'list':
                        self.result=self.classifier.predict_proba(test_file,k=k_best)
                    if csvflag:
                            lines=open(test_file,"r").readlines()
                            sentences=[line.split(" , ")[1] for line in lines]
                            self.result=self.classifier.predict_proba(sentences,k_best)
                except:
                    print("Error in input dataset.. please see if the file/list of sentences is of correct format")
                    sys.exit(-1)
                return(self.result)
def predict_proba ( self , test_file , csvflag = True , k_best = 1 ) : try : if csvflag == False and type ( test_file ) == 'list' : self . result = self . classifier . predict_proba ( test_file , k = k_best ) if csvflag : lines = open ( test_file , "r" ) . readlines ( ) sentences = [ line . split ( " , " ) [ 1 ] for line in lines ] self . result = self . classifier . predict_proba ( sentences , k_best ) except : print ( "Error in input dataset.. please see if the file/list of sentences is of correct format" ) sys . exit ( - 1 ) return ( self . result )
Input: List of sentences
return reort of classification
to do: check output of classifier predct_proba add label option and unit testing
Input : List of sentences return reort of classification to do : check output of classifier predct_proba add label option and unit testing
'''
                Input: List of sentences
                return reort of classification
                to do: check output of classifier predct_proba add label option and unit testing
                '''
self
test_file
csvflag
k_best