gaiusyu / Brain

Brain: Log Parsing with Bidirectional Parallel Tree
Apache License 2.0
27 stars 6 forks source link

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

Open sq2309 opened 1 year ago

sq2309 commented 1 year ago

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

sq2309 commented 1 year ago

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

gaiusyu commented 1 year 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 3 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.

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.