{"id":28234113,"url":"https://github.com/tabularis-ai/be_great","last_synced_at":"2025-06-12T21:32:13.993Z","repository":{"id":61825676,"uuid":"536614303","full_name":"tabularis-ai/be_great","owner":"tabularis-ai","description":"A novel approach for synthesizing tabular data using pretrained large language models","archived":false,"fork":false,"pushed_at":"2025-05-19T09:30:24.000Z","size":4494,"stargazers_count":311,"open_issues_count":8,"forks_count":52,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-27T14:09:26.797Z","etag":null,"topics":["data-generation","deep-learning","synthetic-data","synthetic-dataset-generation","tabular-data","transformers"],"latest_commit_sha":null,"homepage":"https://tabularis.ai/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tabularis-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-14T14:21:23.000Z","updated_at":"2025-05-21T08:04:32.000Z","dependencies_parsed_at":"2024-01-08T09:04:52.691Z","dependency_job_id":"f75f355d-c4c7-41af-8e13-544279677089","html_url":"https://github.com/tabularis-ai/be_great","commit_stats":{"total_commits":74,"total_committers":8,"mean_commits":9.25,"dds":"0.44594594594594594","last_synced_commit":"c65bb735ef4b10d0c677382cdfc7c44fb6e1d351"},"previous_names":["tabularis-ai/be_great","kathrinse/be_great"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tabularis-ai/be_great","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabularis-ai%2Fbe_great","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabularis-ai%2Fbe_great/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabularis-ai%2Fbe_great/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabularis-ai%2Fbe_great/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tabularis-ai","download_url":"https://codeload.github.com/tabularis-ai/be_great/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabularis-ai%2Fbe_great/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259533757,"owners_count":22872454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-generation","deep-learning","synthetic-data","synthetic-dataset-generation","tabular-data","transformers"],"created_at":"2025-05-18T22:13:02.569Z","updated_at":"2025-06-12T21:32:13.984Z","avatar_url":"https://github.com/tabularis-ai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003cimg alt=\"GReaT Logo\" src=\"https://github.com/tabularis-ai/be_great/raw/main/imgs/GReaT_logo.png\" width=\"365\"\u003e\n  \u003c/picture\u003e\n\u003c/div\u003e\n\n\u003ch3 align=\"center\"\u003eGeneration of Realistic Tabular data\u003c/h3\u003e\n\u003cp align=\"center\"\u003ewith pretrained Transformer-based language models\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pypi.org/project/be-great/\"\u003e\n    \u003cimg alt=\"PyPI\" src=\"https://badge.fury.io/py/be-great.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pepy.tech/project/be-great\"\u003e\n    \u003cimg alt=\"Downloads\" src=\"https://static.pepy.tech/badge/be-great\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nOur GReaT framework leverages the power of advanced pretrained Transformer language models to produce high-quality synthetic tabular data. Generate new data samples effortlessly with our user-friendly API in just a few lines of code. Please see our [publication](YOUR_PUBLICATION_LINK) for more details.\n\n\u0026nbsp;\n\n## GReaT Installation\n\nThe GReaT framework can be easily installed using with [pip](https://pypi.org/project/pip/) - requires a Python version \u003e= 3.9: \n```bash\npip install be-great\n```\n\n\n\n## GReaT Quickstart\n\nIn the example below, we show how the GReaT approach is used to generate synthetic tabular data for the California Housing dataset.\n```python\nfrom be_great import GReaT\nfrom sklearn.datasets import fetch_california_housing\n\ndata = fetch_california_housing(as_frame=True).frame\n\nmodel = GReaT(llm='distilgpt2', batch_size=32,  epochs=50,\n              fp16=True, dataloader_num_workers=4)\nmodel.fit(data)\nsynthetic_data = model.sample(n_samples=100)\n```\n\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/kathrinse/be_great/blob/main/examples/GReaT_colab_example.ipynb)\n\n### Imputing a sample\nGReaT also features an interface to impute, i.e., fill in, missing values in arbitrary combinations. This requires a trained ``model``, for instance one obtained using the code snippet above, and a ```pd.DataFrame``` where missing values are set to NaN.\nA minimal example is provided below:\n```python\n# test_data: pd.DataFrame with samples from the distribution\n# model: GReaT trained on the data distribution that should be imputed\n\n# Drop values randomly from test_data\nimport numpy as np\nfor clm in test_data.columns:\n    test_data[clm]=test_data[clm].apply(lambda x: (x if np.random.rand() \u003e 0.5 else np.nan))\n\nimputed_data = model.impute(test_data, max_length=200)\n```\n\n### Saving and Loading\nGReaT provides methods for saving a model checkpoint (besides the checkpoints stored by the huggingface transformers Trainer) and loading the checkpoint again.\n```python\nmodel = GReaT(llm='distilgpt2', batch_size=32,  epochs=50, fp16=True)\nmodel.fit(data)\nmodel.save(\"my_directory\")  # saves a \"model.pt\" and a \"config.json\" file\nmodel = GReaT.load_from_dir(\"my_directory\")  # loads the model again\n\n# supports remote file systems via fsspec\nmodel.save(\"s3://my_bucket\")\nmodel = GReaT.load_from_dir(\"s3://my_bucket\")\n```\n\n## Optimizing GReaT for Challenging Datasets\n\nWhen working with small datasets or datasets with many features, GReaT offers specialized parameters to improve generation quality:\n\n```python\n# For small datasets or datasets with many features\nmodel = GReaT(\n    llm='distilgpt2',\n    float_precision=3,  # Limit floating-point precision to 3 decimal places\n    batch_size=8,       # Use smaller batch size for small datasets\n    epochs=100,         # Train for more epochs with small data\n    fp16=True           # Enable half-precision training for faster computation and lower memory usage\n)\nmodel.fit(data)\n\n# Use guided sampling for higher quality generation with complex feature sets\nsynthetic_data = model.sample(\n    n_samples=100,\n    guided_sampling=True,     # Enable feature-by-feature guided generation\n    random_feature_order=True,  # Randomize feature order to avoid bias\n    temperature=0.7           # Control diversity of generated values\n)\n```\n\nThe `guided_sampling=True` parameter enables a feature-by-feature generation approach, which can produce more reliable results for datasets with many features or complex relationships. While potentially slower than the default sampling method, it can help overcome generation challenges with difficult datasets.\n\nThe `float_precision` parameter limits decimal places in numerical values, which can help the model focus on significant patterns rather than memorizing exact values. This is particularly helpful for small datasets where overfitting is a concern.\n\n## GReaT Citation \n\nIf you use GReaT, please link or cite our work:\n\n``` bibtex\n@inproceedings{borisov2023language,\n  title={Language Models are Realistic Tabular Data Generators},\n  author={Vadim Borisov and Kathrin Sessler and Tobias Leemann and Martin Pawelczyk and Gjergji Kasneci},\n  booktitle={The Eleventh International Conference on Learning Representations },\n  year={2023},\n  url={https://openreview.net/forum?id=cEygmQNOeI}\n}\n```\n\n## Custom Synthetic Data\n\nNeed synthetic data for your business? We can help!\nContact us at info@tabularis.ai for custom data generation services.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabularis-ai%2Fbe_great","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftabularis-ai%2Fbe_great","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabularis-ai%2Fbe_great/lists"}