def load_embeddings(self, embeddings):
    '处理Embedding层权重\n        '
    if (self.keep_tokens is not None):
        embeddings = embeddings[self.keep_tokens]
    if (self.compound_tokens is not None):
        ext_embeddings = []
        for item in self.compound_tokens:
            if isinstance(item, list):
                item = (item, ([1] * len(item)))
            ext_embeddings.append(np.average(embeddings[item[0]], 0, item[1]))
        embeddings = np.concatenate([embeddings, ext_embeddings], 0)
    return embeddings
处理Embedding层权重
def load_embeddings(self, embeddings):
    '\n        '
    if (self.keep_tokens is not None):
        embeddings = embeddings[self.keep_tokens]
    if (self.compound_tokens is not None):
        ext_embeddings = []
        for item in self.compound_tokens:
            if isinstance(item, list):
                item = (item, ([1] * len(item)))
            ext_embeddings.append(np.average(embeddings[item[0]], 0, item[1]))
        embeddings = np.concatenate([embeddings, ext_embeddings], 0)
    return embeddings