def standardize_by_averaging(tokens, embeddings, std_length=10):
    flag = True
    tokens = tokens.copy()
    embeddings = embeddings.copy()
    while (len(tokens) > std_length):
        if flag:
            flag = False
            (tokens, embeddings) = syntactic_rules_for_preprocessing(tokens, embeddings, std_length)
            continue
        length = len(tokens)
        index = random.randint(1, (length - 1))
        embed1 = embeddings[index]
        embed2 = embeddings[(index - 1)]
        averaged_embeddings = average_two_embeddings_vectors(embed1, embed2)
        (token, embeddings) = update_tok_and_embed(tokens, embeddings, index, (index - 1), averaged_embeddings)
    return (tokens, embeddings)
def standardize_by_averaging(tokens, embeddings, std_length=10):
    flag = True
    tokens = tokens.copy()
    embeddings = embeddings.copy()
    while (len(tokens) > std_length):
        if flag:
            flag = False
            (tokens, embeddings) = syntactic_rules_for_preprocessing(tokens, embeddings, std_length)
            continue
        length = len(tokens)
        index = random.randint(1, (length - 1))
        embed1 = embeddings[index]
        embed2 = embeddings[(index - 1)]
        averaged_embeddings = average_two_embeddings_vectors(embed1, embed2)
        (token, embeddings) = update_tok_and_embed(tokens, embeddings, index, (index - 1), averaged_embeddings)
    return (tokens, embeddings)