CoolFace
Datasetpublic

23ws-LLMcoder/LLMcoder-GitHub-Python-Mix-Direct

Dataset Card for LLMcoder-GitHub-Python-Mix-Direct Python target autocomplete suggestions in the format of conversations for OpenAI's fine-tuning. Dataset Details Dataset Description Curated by: [More Information Needed] Funded by [optional]: [More Information Needed] Shared by [optional]: [More Information Needed] Language(s) (NLP): [More Information Needed] License: [More Information Needed] Dataset Sources [optional] The data… See the full description on the dataset page: https://huggingface.co/datasets/23ws-LLMcoder/LLMcoder-GitHub-Python-Mix-Direct.

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes216downloads
input.txt74 linesDownload Raw Back to pair_13
1on2            maps or list of prediction result filenames.3        gt_seg_maps (list[ndarray] | list[str]): list of ground truth4            segmentation maps or list of label filenames.5        num_classes (int): Number of categories.6        ignore_index (int): Index that will be ignored in evaluation.7        nan_to_num (int, optional): If specified, NaN values will be replaced8            by the numbers defined by the user. Default: None.9        label_map (dict): Mapping old labels to new labels. Default: dict().10        reduce_zero_label (bool): Wether ignore zero label. Default: False.11        beta (int): Determines the weight of recall in the combined score.12            Default: False.13 14 15     Returns:16        dict[str, float | ndarray]: Default metrics.17            <aAcc> float: Overall accuracy on all images.18            <Fscore> ndarray: Per category recall, shape (num_classes, ).19            <Precision> ndarray: Per category precision, shape (num_classes, ).20            <Recall> ndarray: Per category f-score, shape (num_classes, ).21    """22    fscore_result = eval_metrics(23        results=results,24        gt_seg_maps=gt_seg_maps,25        num_classes=num_classes,26        ignore_index=ignore_index,27        metrics=['mFscore'],28        nan_to_num=nan_to_num,29        label_map=label_map,30        reduce_zero_label=reduce_zero_label,31        beta=beta)32    return fscore_result33 34 35def eval_metrics(results,36                 gt_seg_maps,37                 num_classes,38                 ignore_index,39                 metrics=['mIoU'],40                 nan_to_num=None,41                 label_map=dict(),42                 reduce_zero_label=False,43                 beta=1):44    """Calculate evaluation metrics45    Args:46        results (list[ndarray] | list[str]): List of prediction segmentation47            maps or list of prediction result filenames.48        gt_seg_maps (list[ndarray] | list[str]): list of ground truth49            segmentation maps or list of label filenames.50        num_classes (int): Number of categories.51        ignore_index (int): Index that will be ignored in evaluation.52        metrics (list[str] | str): Metrics to be evaluated, 'mIoU' and 'mDice'.53        nan_to_num (int, optional): If specified, NaN values will be replaced54            by the numbers defined by the user. Default: None.55        label_map (dict): Mapping old labels to new labels. Default: dict().56        reduce_zero_label (bool): Wether ignore zero label. Default: False.57     Returns:58        float: Overall accuracy on all images.59        ndarray: Per category accuracy, shape (num_classes, ).60        ndarray: Per category evaluation metrics, shape (num_classes, ).61    """62    if isinstance(metrics, str):63        metrics = [metrics]64    allowed_metrics = ['mIoU', 'mDice', 'mFscore']65    if not set(metrics).issubset(set(allowed_metrics)):66        raise KeyError('metrics {} is not supported'.format(metrics))67 68    total_area_intersect, total_area_union, total_area_pred_label, \69        total_area_label = total_intersect_and_union(70            results, gt_seg_maps, num_classes, ignore_index, label_map,71            reduce_zero_label)72    all_acc = total_area_intersect.sum() / total_area_label.sum()73    ret_metrics = OrderedDict({'aAcc': all_acc})74    for metri