Commit 939fd0aa authored by Geoffrey Yu's avatar Geoffrey Yu Committed by Jennifer Wei
Browse files

make sure no padded features are going to be selected as anchors

parent 9f964fe3
...@@ -120,7 +120,7 @@ def get_least_asym_entity_or_longest_length(batch:dict, input_asym_id:list)->Tup ...@@ -120,7 +120,7 @@ def get_least_asym_entity_or_longest_length(batch:dict, input_asym_id:list)->Tup
anchor_pred_asym_ids: list(Tensor(int)) a list of all possible pred anchor candidates anchor_pred_asym_ids: list(Tensor(int)) a list of all possible pred anchor candidates
""" """
entity_2_asym_list = get_entity_2_asym_list(batch) entity_2_asym_list = get_entity_2_asym_list(batch)
unique_entity_ids = torch.unique(batch["entity_id"]) unique_entity_ids = [i for i in torch.unique(batch["entity_id"]) if i !=0]# if entity_id is 0, that means this entity_id comes from padding
entity_asym_count = {} entity_asym_count = {}
entity_length = {} entity_length = {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment