Datasets:

Modalities:
Tabular
Text
Formats:
parquet
Size:
< 1K
Libraries:
Datasets
pandas

You need to agree to share your contact information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Terms of Use for The Stack

The Stack dataset is a collection of source code in over 300 programming languages. We ask that you read and acknowledge the following points before using the dataset:

  1. The Stack is a collection of source code from repositories with various licenses. Any use of all or part of the code gathered in The Stack must abide by the terms of the original licenses, including attribution clauses when relevant. We facilitate this by providing provenance information for each data point.
  2. The Stack is regularly updated to enact validated data removal requests. By clicking on "Access repository", you agree to update your own version of The Stack to the most recent usable version specified by the maintainers in the following thread. If you have questions about dataset versions and allowed uses, please also ask them in the dataset’s community discussions. We will also notify users via email when the latest usable version changes.
  3. To host, share, or otherwise provide access to The Stack dataset, you must include these Terms of Use and require users to agree to it.

By clicking on "Access repository" below, you accept that your contact information (email address and username) can be shared with the dataset maintainers as well.

Log in or Sign Up to review the conditions and access this dataset content.

Dataset Card for "ts-eval"

This is a dataset of 744 high-quality TypeScript files, meant for evaluation of type prediction systems. The dataset is derived from TypeScript portion of The Stack (dedup), version 1.1, and filtered.

Filtering steps

We remove files that:

  1. Depend on external modules and do not type check.
  2. Have 0 type annotation locations.
  3. Have 50 or fewer lines of code.
  4. Have 0 functions.
  5. Average fewer than 5 lines of code per function.

Next, we compute a weighted quality score, based on the following factors:

  • function annotation density
  • variable annotation density
  • type definition density
  • trivial types density
  • predefined types density
  • lines of code per function
  • number of function usages

Files with a score 1 or more standard deviations below the mean are removed.

Next, we apply the training cutoff (December 31, 2021).

Finally, we remove type annotations. Some files become invalid during this process, so we exclude them from the dataset.

Data fields

Most of the data fields come from The Stack.

We add the following fields:

  • loc (integer): lines of code, excluding comments and blanks
  • functions (integer): number of functions that have function bodies; includes function expressions, arrow functions, and methods
  • function_signatures (integer): number of function signatures, i.e., function declarations with no bodies
  • function_parameters (integer): number of function parameters
  • variable_declarations (integer): number of variable declarations
  • property_declarations (integer): number of property declarations, i.e., within classes and interfaces
  • function_usages (integer): number of functions (defined within the file) that are called
  • trivial_types (integer): number of trivial type annotations, e.g. any, Function
  • predefined_types (integer): number of predefined type annotations, e.g. boolean, number, string
  • type_definitions (integer): number of type definitions, e.g. classes, interfaces, type aliases
  • dynamism_heuristic (integer): a count of dynamic language features, e.g. eval, run-time type tests
  • loc_per_function (float): average lines of code per function
  • estimated_tokens (integer): estimated token count, using the SantaCoder tokenizer
  • fun_ann_density (float): a measure of function annotation density
  • var_ann_density (float): a measure of variable annotation density
  • prop_ann_density (float): a measure of property annotation density
  • typedef_density (float): a measure of type definition density
  • dynamism_density (float): a measure of dynamic feature usage density
  • trivial_density (float): a measure of trivial type annotation density
  • predefined_density (float): a measure of predefined type annotation density
  • metric (float): the quality score
  • content_without_annotations (string): content of the file, with type annotations removed

Versions

The default version (main) is v1.1.

Version Description
v1.1 Original version of the evaluation dataset, based on v1.1 of the Stack. Applies the training cutoff (December 31, 2021).
v1.1full Evaluation dataset, based on v1.1 of the Stack. Does not apply the training cutoff.
v1.1subset A subset of v1.1 containing only 50 files.
Downloads last month
38

Collection including nuprl/stenotype-ts-eval