license:mit size_categories:n<1K format:csv modality:text library:datasets library:pandas library:mlcroissant library:polars region:us infinite-dataset-hub synthetic
---
license: mit
tags:
- infinite-dataset-hub
- synthetic
---

# CodeGenreClassifier

tags: Programming, Language, HTML, Code Identifier, Genre Classification

_Note: This is an AI-generated dataset so its content may be inaccurate or false_

**Dataset Description:**

The 'CodeGenreClassifier' dataset is designed to assist machine learning practitioners in training models for the purpose of classifying code snippets into their respective programming language genres, such as Python, Java, or HTML. Each row in the dataset represents a code snippet with a corresponding label that indicates the programming language genre it belongs to. The dataset is intended for use in natural language processing and machine learning tasks focusing on code genre classification.

**CSV Content Preview:**

```
id,code_snippet,label
0,"def hello_world():\n    print('Hello, world!')","Python"
1,"public class HelloWorld {\n    public static void main(String[] args) {\n        System.out.println('Hello, world!');\n    }","Java"
2,"<!DOCTYPE html>\n<html>\n<body>\n<h1>Hello World</h1>\n</body>\n</html>","HTML"
3,"class HelloWorld:\n    def __init__(self):\n        self.message = 'Hello, world!'\n    def greet(self):\n        print(self.message)\n","Python"
4,"<script>\nfunction greet() {\n    alert('Hello, world!');\n}\n</script>","HTML"
```

In this sample, we have four rows of data, with each snippet demonstrating a basic structure for 'Hello, world!' output in the specified language. The 'label' column accurately identifies the programming language genre for each snippet. This example provides a quality dataset for practitioners looking to train and evaluate machine learning models on the task of identifying the programming language of given code snippets.

**Source of the data:**

The dataset was generated using the [Infinite Dataset Hub](https://huggingface.co/spaces/infinite-dataset-hub/infinite-dataset-hub) and microsoft/Phi-3-mini-4k-instruct using the query 'python vs java vs html code identifier dataset':

- **Dataset Generation Page**: https://huggingface.co/spaces/infinite-dataset-hub/infinite-dataset-hub?q=python+vs+java+vs+html+code+identifier+dataset&dataset=CodeGenreClassifier&tags=Programming,+Language,+HTML,+Code+Identifier,+Genre+Classification
- **Model**: https://huggingface.co/microsoft/Phi-3-mini-4k-instruct
- **More Datasets**: https://huggingface.co/datasets?other=infinite-dataset-hub
