transformer.py
def fill_corpus(self, log_file, log_dir=None, bert_format=False):
        """
        read a log file (each line has a sequence of unique event names called by a single source,
        i.e, one log file per one source in AWS )
        and convert it to a list of unique sequence of logs
        """
        if log_dir is not None: log_file = log_dir+log_file

        corpus = []
        try:
            with open(log_file, 'r') as input_file:
                # read the file and remove repeated lines!
                if bert_format:
                    for line in input_file.readlines():
                        corpus.append(torch.tensor(list(int(num) for num in line.split(' ')), dtype=torch.int))
                else:
                    corpus = set([line.rstrip("\n") for line in input_file.readlines()])
        except Exception as e:
            print("Problem with the input log file due to {0}".format(str(e)))

        return corpus

        read a log file (each line has a sequence of unique event names called by a single source,
        i.e, one log file per one source in AWS )
        and convert it to a list of unique sequence of logs
        
read a log file (each line has a sequence of unique event names called by a single source,
i.e, one log file per one source in AWS )
and convert it to a list of unique sequence of logs
read a log file ( each line has a sequence of unique event names called by a single source i . e one log file per one source in AWS ) and convert it to a list of unique sequence of logs
def fill_corpus(self, log_file, log_dir=None, bert_format=False):
        if log_dir is not None: log_file = log_dir+log_file
        corpus = []
        try:
            with open(log_file, 'r') as input_file:
                if bert_format:
                    for line in input_file.readlines():
                        corpus.append(torch.tensor(list(int(num) for num in line.split(' ')), dtype=torch.int))
                else:
                    corpus = set([line.rstrip("\n") for line in input_file.readlines()])
        except Exception as e:
            print("Problem with the input log file due to {0}".format(str(e)))
        return corpus
def fill_corpus ( self , log_file , log_dir = None , bert_format = False ) : if log_dir is not None : log_file = log_dir + log_file corpus = [ ] try : with open ( log_file , 'r' ) as input_file : if bert_format : for line in input_file . readlines ( ) : corpus . append ( torch . tensor ( list ( int ( num ) for num in line . split ( ' ' ) ) , dtype = torch . int ) ) else : corpus = set ( [ line . rstrip ( "\n" ) for line in input_file . readlines ( ) ] ) except Exception as e : print ( "Problem with the input log file due to {0}" . format ( str ( e ) ) ) return corpus
read a log file (each line has a sequence of unique event names called by a single source,
i.e, one log file per one source in AWS )
and convert it to a list of unique sequence of logs
read a log file ( each line has a sequence of unique event names called by a single source i . e one log file per one source in AWS ) and convert it to a list of unique sequence of logs
"""
        read a log file (each line has a sequence of unique event names called by a single source,
        i.e, one log file per one source in AWS )
        and convert it to a list of unique sequence of logs
        """ # read the file and remove repeated lines!
self
log_file
log_dir
bert_format