gaiusyu / Brain

Brain: Log Parsing with Bidirectional Parallel Tree
26 stars 6 forks source link

Comparing between the different object (int == tuple) #2

Open sq2309 opened 11 months ago

sq2309 commented 11 months ago

https://github.com/gaiusyu/Brain/blob/4b9151d16583cf5b558aa6f251eb67cfd2a3b546/Brain/Brain.py#L197C39-L197C39

sq2309 commented 11 months ago

Per the code, father[0] is a number, but root_set_detail[][][] is a tuple, so we get false always here...

gaiusyu commented 11 months ago

Thanks for your interest. I reviewed this part of the code carefully, it is about parent node update. These codes are used to implement the functionality where all the words in a parent column are treated as variables once a different word appears in the parent column. It seems that the code execution on the benchmark dataset doesn't involve this part of the code. I recommend changing 'root_set_detail[][][]' to 'root_set_detail[][][][0]' and then applying it to your dataset.

lezhang-thu commented 1 month ago

Thanks for your interest. I reviewed this part of the code carefully, it is about parent node update. These codes are used to implement the functionality where all the words in a parent column are treated as variables once a different word appears in the parent column. It seems that the code execution on the benchmark dataset doesn't involve this part of the code. I recommend changing 'root_set_detail[][][]' to 'root_set_detail[][][][0]' and then applying it to your dataset.

Change it to root_set_detail[][][][0], then the the condition of if father[0] == root_set_detail[key][i][k]: will be triggered. So "involve" rather than "doesn't involve" as commented above by the author.