<commit_before>from experiment_construction.example_processor_construction.abstract_example_processor import AbstractExampleProcessor
import numpy as np


class GraphSplitExampleProcessor(AbstractExampleProcessor):

    def process_example(self, example, mode="train"):
        graph = example["neighborhood"]
        centroids = [example["neighborhood"].to_index(c) for c in example["sentence_entity_map"][:, 2]]
        if centroids.shape[0] > 0:
            centroids = np.concatenate(centroids)
        example["neighborhood"].set_centroids(centroids)
        example["neighborhood"] = graph.get_split_graph()

        return True<commit_msg>names<commit_after>from experiment_construction.example_processor_construction.abstract_example_processor import AbstractExampleProcessor
import numpy as np


class GraphSplitExampleProcessor(AbstractExampleProcessor):

    def process_example(self, example, mode="train"):
        graph = example["neighborhood"]
        centroids = [example["neighborhood"].to_index(c) for c in example["sentence_entity_map"][:, 2]]
        if len(centroids) > 0:
            centroids = np.concatenate(centroids)
        example["neighborhood"].set_centroids(centroids)
        example["neighborhood"] = graph.get_split_graph()

        return True
{'fraction_non_alphanumeric': 0.09765625, 'fraction_numerical': 0.00390625, 'mean_word_length': 4.71875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6991712', 'n_tokens_mistral': 350, 'n_tokens_neox': 340, 'n_words': 65}