Home
Softono
a

allenai

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
6

Software by allenai

RL4LMs
Open Source

RL4LMs

<p align="center"> <img src="RL4LMs_logo.png" width=512px> </p> <h1 align="center"> :robot: RL4LMs :rocket: </h1> <h3 align="center"> A modular RL library to fine-tune language models to human preferences </h3> <br> We provide easily customizable building blocks for training language models including implementations of **on-policy algorithms**, **reward functions**, **metrics**, **datasets** and **LM based actor-critic policies** Paper Link: https://arxiv.org/abs/2210.01241 Website Link: https://rl4lms.apps.allenai.org/ Thoroughly **tested** and **benchmarked** with over **2000 experiments** :fire: (GRUE benchmark :trophy:) on a comprehensive set of: - 7 different Natural Language Processing (NLP) Tasks: - Summarization - Generative Commonsense Reasoning - IMDB Sentiment-based Text Continuation - Table-to-text generation - Abstractive Question Answering - Machine Translation - Dialogue Generation - Different types of NLG metrics (20+) which can be used as reward functions: - Lexical Metrics (eg: ROUGE, BLEU, SacreBLEU, METEOR) - Semantic Metrics (eg: BERTSCORE, BLEURT) - Task specific metrics (eg: PARENT, CIDER, SPICE) - Scores from pre-trained classifiers (eg: Sentiment scores) - On-policy algorithms of PPO, A2C, TRPO and novel **NLPO (Natural Language Policy Optimization)** - Actor-Critic Policies supporting causal LMs (eg. GPT-2/3) and seq2seq LMs (eg. T5, BART) All of these building blocks can be customizable allowing users to train transformer-based LMs to optimize any arbitrary reward function on any dataset of their choice. ## Recent updates (v0.2.0) on 23-Nov-22 - Added daily dialog task - Fixed compatibility issues with some Seq2seq models such as BART, blendorbot etc - Implemented data parallel support - Refactored policy classes ## Recent updates (v0.2.1) - Minor logging updates --- # Install ## Local Installation ```bash git clone https://github.com/allenai/RL4LMs.git cd RL4LMs pip install -e . ``` ## Docker We provide also a Dockerfile for development using docker containers containing all the dependencies. ```bash docker build . -t rl4lms ``` ## Additional dependencies Optionally, coreNLP libraries are required for certain metric computations (eg. SPICE) which can be downloaded through `cd rl4lms/envs/text_generation/caption_metrics/spice && bash get_stanford_models.sh` --- # Quick Start - Train PPO/NLPO using pre-defined YAML configs We provide a simple training API that can be invoked via train [script](https://github.com/allenai/RL4LMs/blob/main/scripts/training/train_text_generation.py) that allows to train PPO, NLPO or a supervised model by using a config file (YAML). For example, to train T5-base on CNN/DM summarization on PPO using Rouge-1 as reward function, you can run: ```bash python scripts/training/train_text_generation.py --config_path scripts/training/task_configs/summarization/t5_ppo.yml ``` Config files for all tasks can be found [here](https://github.com/allenai/RL4LMs/tree/main/scripts/training/task_configs). ## YAML file schema - Configuring building blocks Config file contains details about hyper-parameter settings for building blocks which are described below: - **Dataset/Task**: Dataset containing samples with input prompts and reference sentences. Available datasets are found in the class `DataPoolRegistry` in [registry](https://github.com/allenai/RL4LMs/blob/main/rl4lms/envs/text_generation/registry.py). (See how to create your own dataset [here](#adding-dataset)) ```yaml datapool: id: cnn_daily_mail args: prompt_prefix: "Summarize: " ``` - **Tokenizer** - A pre-trained tokenizer that is used to (de)tokenize input and output sequences with settings for padding and truncation ```yaml tokenizer: model_name: t5-base padding_side: left truncation_side: left pad_token_as_eos_token: False ``` - **Reward Function**: Reward function which computes token-level scores at each time step of MDP. Available reward functions can be found in the class `RewardFunctionRegistry`. (See how to create your own reward function [here](#adding-reward-function)) ```yaml reward_fn: id: rouge args: rouge_type: "rouge1" ``` - **Environment**: Configures a gym-style text generation [environment](https://github.com/allenai/RL4LMs/blob/main/rl4lms/envs/text_generation/env.py) which simulates MDP episodes. Rollouts are generated using train samples from dataset consisting of input and reference texts. Further, we wrap our env with `SubProcVecEnv` from stable-baselines that processes `n_envs` episodes in parallel using multi-processing to compute step-wise rewards. Further configuration settings include: - `max_episode_length` : max length of the episode - `max_prompt_length` - maximum length of the input text to consider - `terminate_on_eos` - whether to terminate the episode as soon as EOS action is performed - `prompt_truncation_side` - truncation side for the prompt text - `context_start_token` - id for context token (corresponds to initial token given to decoder in encoder-decoder models) ```yaml env: n_envs: 10 args: max_prompt_length: 512 max_episode_length: 100 terminate_on_eos: True prompt_truncation_side: "right" context_start_token: 0 ``` - **On-policy alg**: We provide implementations of 4 on-policy algorithms: PPO, NLPO, A2C and TRPO adapted from [stable-baselines3](https://github.com/DLR-RM/stable-baselines3) tailored to work with NLP tasks which can be used out-of-the-box with either a causal policy or a seq2seq LM policy. (See how to create your own [on-policy algorithm](#adding-custom-on-policy-algorithms) or [policy](#adding-custom-policies)) - We also provide a supervised [trainer](https://github.com/allenai/RL4LMs/blob/2863116cd5860e4a4106a76486e70bfac25df2ba/rl4lms/envs/text_generation/training_utils.py#L225) for benchmarking purposes. Supervised Warm start models are already uploaded to Huggingface Hub and specified in the respective config files. - Hyper-parameters for the algorithm can be specified at `alg/args`. - Further, all RL algorithms use adaptive KL controller to keep the LM close to original LM by setting initial KL co-efficient (`alg/kl_div/coeff`) and target KL (`alg/kl_div/target_kl`). - We support two types of LM policy: **causal LM policy** (for decoder only models) and **seq2seq LM policy** (for encoder-decoder models). Further for NLPO, we also provide maskable variants of these. Policy implementations can be found [here](https://github.com/allenai/RL4LMs/blob/main/rl4lms/envs/text_generation/policy.py) in and it can be attached to algorithms by specifying `alg/policy/id` and `alg/policy/args` ```yaml alg: id: ppo args: n_steps: 512 batch_size: 64 verbose: 1 learning_rate: 0.000002 n_epochs: 5 ent_coef: 0.0 kl_div: coeff: 0.001 target_kl: 0.2 policy: id: seq2seq_lm_actor_critic_policy args: model_name: t5-base apply_model_parallel: True prompt_truncation_side: "right" generation_kwargs: do_sample: True top_k: 50 min_length: 50 max_new_tokens: 100 ``` - **Trainer Config**: We provide an [On-policy trainer](https://github.com/allenai/RL4LMs/blob/2863116cd5860e4a4106a76486e70bfac25df2ba/rl4lms/envs/text_generation/training_utils.py#L126) - a feature-complete wrapper that instantiates building blocks from their corresponding configs and provides an outer training loop consisting of *train* and *eval* iterations `train_evaluation/n_iters`. - Each iteration corresponds to performing updates with `alg/args/n_steps` x `env/n_envs` of the chosen algorithm. - For every `eval_every` iters, LM is evaluated on validation split using metrics listed in `train_evaluation/metrics` with generation kwargs provided in `train_evaluation/generation_kwargs` (this overrides rollout `alg/policy/generation_kwargs` for inference purposes only) ```yaml # train and evaluation train_evaluation: eval_batch_size: 100 n_iters: 100 eval_every: 10 save_every: 1 metrics: - id: meteor args: {} - id: rouge - id: bleu args: {} - id: bert_score args: language: en - id: diversity args: {} generation_kwargs: do_sample: True top_k: 0 temperature: 0.7 min_length: 50 max_new_tokens: 100 ``` --- # Custom Building Blocks :wrench: RL4LMs provide complete customizability - with respect to adding new tasks/datasets, reward functions, evaluation metric, on-policy algorithms and actor-critic policies. ## Adding dataset Users can create their own datasets by sub-classing [TextGenPool](https://github.com/allenai/RL4LMs/blob/af5a1326578789856ca8550cb5496c9ccc1afdc5/rl4lms/data_pools/text_generation_pool.py#L15) just by overriding `prepare(cls, split: str, **args) -> 'TextGenPool':` method to return an instance of TextGenPool. An example is shown below: ```python from rl4lms.data_pools.text_generation_pool import Sample, TextGenPool class MyDataPool(TextGenPool): @classmethod def prepare(cls, split: str): .. samples = [] for ix, item in enumerate(..): sample = Sample(id=f"{split}_{ix}", prompt_or_input_text=item["document"], references=[item["target"]] ) samples.append(sample) pool_instance = cls(samples) return pool_instance ``` ## Adding reward function Custom reward funtions can be implemented easily by sub-classing [RewardFunction](https://github.com/allenai/RL4LMs/blob/af5a1326578789856ca8550cb5496c9ccc1afdc5/rl4lms/envs/text_generation/reward.py#L12) (a callable) which takes observation ($s$), next observation ($s'$), action ($a$), done (indicating whether episode is finished) and meta info (containing other information about textual input). Here, [Observation](https://github.com/allenai/RL4LMs/blob/af5a1326578789856ca8550cb5496c9ccc1afdc5/rl4lms/envs/text_generation/observation.py#L11) is a data class object consisting of generated text (at a particular step), prompt text, context text (at that step), reference text which can be used to compute token-level or sentence level rewards. ```python from rl4lms.envs.text_generation.observation import Observation from rl4lms.envs.text_generation.reward import RewardFunction class MyRewardFunction(RewardFunction): def __init__(self, *args) -> None: super().__init__() def __call__(self, prev_observation: Observation, action: int, current_observation: Observation, done: bool, meta_info: Dict[str, Any] = None) -> float: if done: reward = .. return reward return 0 ``` :bulb: In addition to traditional NLG metrics, for quick prototyping, we provide two synthetic reward functions which trains LMs to [generate numbers](https://github.com/allenai/RL4LMs/blob/af5a1326578789856ca8550cb5496c9ccc1afdc5/rl4lms/envs/text_generation/test_reward.py#L8) in increasing order and [generate dates](https://github.com/allenai/RL4LMs/blob/af5a1326578789856ca8550cb5496c9ccc1afdc5/rl4lms/envs/text_generation/test_reward.py#L54). These can be used to quickly test different algorithms and policies. Corresponding configs can be found here ([numbers](https://github.com/allenai/RL4LMs/tree/main/scripts/training/task_configs/synthetic_generate_increasing_numbers), [dates](https://github.com/allenai/RL4LMs/tree/main/scripts/training/task_configs/synthetic_generate_dates)) ## Adding custom metrics Users can create their own evaluation metric which then will be used to periodically evaluate the model on validation split of dataset. This can be done by sub-classing [BaseMetric](https://github.com/allenai/RL4LMs/blob/af5a1326578789856ca8550cb5496c9ccc1afdc5/rl4lms/envs/text_generation/metric.py#L20) which takes prompt texts, generated texts, reference texts, meta_infos, current LM model, split name as inputs and returns a dict with metric name as key and value consisting of tuple of sentence-level scores and corpus level scores. An example is as follows: ```python from rl4lms.envs.text_generation.metric import BaseMetric class MyMetric(BaseMetric): def __init__(self) -> None: super().__init__() def compute(self, prompt_texts: List[str], generated_texts: List[str], reference_texts: List[List[str]], meta_infos: List[Dict[str, Any]] = None, model: PreTrainedModel = None, split_name: str = None): metric_dict = { "custom_metrics/my_metric": ([0.4, 0.7, 0.9], 0.7) } return metric_dict ``` ## Adding custom on-policy algorithms In addition to supported on-policy algorithms (PPO, NLPO, A2C,TRPO), users can implement their own on-policy algorithms with ease by sub-classing stable-baselines3's [OnPolicyAlgorithm](https://github.com/DLR-RM/stable-baselines3/blob/a697401e032dd4fecbbd4162755ddd707df980d3/stable_baselines3/common/on_policy_algorithm.py#L20). Since we provide [wrappers](https://github.com/allenai/RL4LMs/blob/af5a1326578789856ca8550cb5496c9ccc1afdc5/rl4lms/envs/text_generation/alg_wrappers.py#L67) for on-policy algorithms that handles rollouts using LM policies, environment, computing rewards etc, users just need to implement `train()` method with custom loss functions. ```python from stable_baselines3.common.on_policy_algorithm import OnPolicyAlgorithm class MyOnPolicyAlgorithm(OnPolicyAlgorithm): def __init__(**args): super().__init__(**args) def train(self) -> None: # train for n_epochs epochs for epoch in range(self.n_epochs): # Do a complete pass on the rollout buffer for rollout_data in self.rollout_buffer.get(self.batch_size): # compute loss ``` ## Adding custom policies We provide LM based actor-critic policy [implementations](https://github.com/allenai/RL4LMs/blob/main/rl4lms/envs/text_generation/policy.py) that wraps causal LM and seq2seq LMs. These can be also extended (for eg: use a different critic architecture) by overriding appropriate methods (eg. `evaluate_actions()`) ## Registry Finally, just register your custom components by adding them to corresponding [registry](https://github.com/allenai/RL4LMs/blob/main/rl4lms/envs/text_generation/registry.py), after which they can be used directly from configs similar to pre-defined components :wave: ## Crowdsourcing templates We have provided the crowdsourcing templates we used on mechanical turk, along with example inputs in `scripts/crowdworking_templates`. You might find these a helpful starting point either for evaluating your own model's generations, or for gathering training data for a learned reward function. --- # Logging and Experiment Results Additionally, we support WANDB logging and warm-starting of training by storing checkpoints and other training artifacts in a user-specified path. This is especially useful for running preemptible jobs on large, scheduled clusters. Artifacts include (1) jsonl file containing rollout infos at specified intervals (2) jsonl file containing training infos at specified intervals (3) jsonl file containing validation metrics at specified intervals (4) jsonl file containing test metrics before and after training (5) json file with validation predictions at specified intervals (6) json file with test predictions before and after training (7) trained LM model (8) config json used to run the experiment Complete usage is as follows: ```bash WANDB_API_KEY=<YOUR-WANDB-API-KEY-HERE> python scripts/training/train_text_generation.py \ --config_path <PATH-TO-CONFIG-FILE> \ --experiment_name <EXPERIMENT-NAME> \ --base_path_to_store_results <PATH-TO-STORE-RESULTS> \ --log_to_wandb ``` --- # Citation ```bibtex @inproceedings{Ramamurthy2022IsRL, title={Is Reinforcement Learning (Not) for Natural Language Processing?: Benchmarks, Baselines, and Building Blocks for Natural Language Policy Optimization}, author={Rajkumar Ramamurthy and Prithviraj Ammanabrolu and Kiant{\'e} Brantley and Jack Hessel and Rafet Sifa and Christian Bauckhage and Hannaneh Hajishirzi and Yejin Choi}, journal={arXiv preprint arXiv:2210.01241}, url={https://arxiv.org/abs/2210.01241}, year={2022} } ``` # Questions/Discussion/Ideas? For discussion, questions, ideas exchange, join our slack channel [![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=slack&logoColor=white)](https://join.slack.com/t/slack-1sa3880/shared_invite/zt-1idqlnbnm-NIiZeMIOpYReXfX9uIT_PA)

ML Frameworks
2.4K Github Stars
scibert
Open Source

scibert

[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/named-entity-recognition-bc5cdr)](https://paperswithcode.com/sota/named-entity-recognition-bc5cdr?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/relation-extraction-chemprot)](https://paperswithcode.com/sota/relation-extraction-chemprot?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/participant-intervention-comparison-outcome)](https://paperswithcode.com/sota/participant-intervention-comparison-outcome?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/named-entity-recognition-ncbi-disease)](https://paperswithcode.com/sota/named-entity-recognition-ncbi-disease?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/sentence-classification-paper-field)](https://paperswithcode.com/sota/sentence-classification-paper-field?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/citation-intent-classification-scicite)](https://paperswithcode.com/sota/citation-intent-classification-scicite?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/sentence-classification-sciencecite)](https://paperswithcode.com/sota/sentence-classification-sciencecite?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/relation-extraction-scierc)](https://paperswithcode.com/sota/relation-extraction-scierc?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/named-entity-recognition-scierc)](https://paperswithcode.com/sota/named-entity-recognition-scierc?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/citation-intent-classification-acl-arc)](https://paperswithcode.com/sota/citation-intent-classification-acl-arc?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/sentence-classification-acl-arc)](https://paperswithcode.com/sota/sentence-classification-acl-arc?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/dependency-parsing-genia-las)](https://paperswithcode.com/sota/dependency-parsing-genia-las?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/dependency-parsing-genia-uas)](https://paperswithcode.com/sota/dependency-parsing-genia-uas?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/named-entity-recognition-jnlpba)](https://paperswithcode.com/sota/named-entity-recognition-jnlpba?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/sentence-classification-pubmed-20k-rct)](https://paperswithcode.com/sota/sentence-classification-pubmed-20k-rct?p=scibert-pretrained-contextualized-embeddings) [![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/scibert-pretrained-contextualized-embeddings/sentence-classification-scicite)](https://paperswithcode.com/sota/sentence-classification-scicite?p=scibert-pretrained-contextualized-embeddings) # <p align=center>`SciBERT`</p> `SciBERT` is a `BERT` model trained on scientific text. * `SciBERT` is trained on papers from the corpus of [semanticscholar.org](https://semanticscholar.org). Corpus size is 1.14M papers, 3.1B tokens. We use the full text of the papers in training, not just abstracts. * `SciBERT` has its own vocabulary (`scivocab`) that's built to best match the training corpus. We trained cased and uncased versions. We also include models trained on the original BERT vocabulary (`basevocab`) for comparison. * It results in state-of-the-art performance on a wide range of scientific domain nlp tasks. The details of the evaluation are in the [paper](https://arxiv.org/abs/1903.10676). Evaluation code and data are included in this repo. ### Downloading Trained Models Update! SciBERT models now installable directly within Huggingface's framework under the `allenai` org: ``` from transformers import * tokenizer = AutoTokenizer.from_pretrained('allenai/scibert_scivocab_uncased') model = AutoModel.from_pretrained('allenai/scibert_scivocab_uncased') tokenizer = AutoTokenizer.from_pretrained('allenai/scibert_scivocab_cased') model = AutoModel.from_pretrained('allenai/scibert_scivocab_cased') ``` ------ We release the tensorflow and the pytorch version of the trained models. The tensorflow version is compatible with code that works with the model from [Google Research](https://github.com/google-research/bert). The pytorch version is created using the [Hugging Face](https://github.com/huggingface/pytorch-pretrained-BERT) library, and this repo shows how to use it in AllenNLP. All combinations of `scivocab` and `basevocab`, `cased` and `uncased` models are available below. Our evaluation shows that `scivocab-uncased` usually gives the best results. #### Tensorflow Models * __[`scibert-scivocab-uncased`](https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/tensorflow_models/scibert_scivocab_uncased.tar.gz) (Recommended)__ * [`scibert-scivocab-cased`](https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/tensorflow_models/scibert_scivocab_cased.tar.gz) * [`scibert-basevocab-uncased`](https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/tensorflow_models/scibert_basevocab_uncased.tar.gz) * [`scibert-basevocab-cased`](https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/tensorflow_models/scibert_basevocab_cased.tar.gz) #### PyTorch AllenNLP Models * __[`scibert-scivocab-uncased`](https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/pytorch_models/scibert_scivocab_uncased.tar) (Recommended)__ * [`scibert-scivocab-cased`](https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/pytorch_models/scibert_scivocab_cased.tar) * [`scibert-basevocab-uncased`](https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/pytorch_models/scibert_basevocab_uncased.tar) * [`scibert-basevocab-cased`](https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/pytorch_models/scibert_basevocab_cased.tar) #### PyTorch HuggingFace Models * __[`scibert-scivocab-uncased`](https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/huggingface_pytorch/scibert_scivocab_uncased.tar) (Recommended)__ * [`scibert-scivocab-cased`](https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/huggingface_pytorch/scibert_scivocab_cased.tar) * [`scibert-basevocab-uncased`](https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/huggingface_pytorch/scibert_basevocab_uncased.tar) * [`scibert-basevocab-cased`](https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/huggingface_pytorch/scibert_basevocab_cased.tar) ### Using SciBERT in your own model SciBERT models include all necessary files to be plugged in your own model and are in same format as BERT. If you are using Tensorflow, refer to Google's [BERT repo](https://github.com/google-research/bert) and if you use PyTorch, refer to [Hugging Face's repo](https://github.com/huggingface/pytorch-pretrained-BERT) where detailed instructions on using BERT models are provided. ### Training new models using AllenNLP To run experiments on different tasks and reproduce our results in the [paper](https://arxiv.org/abs/1903.10676), you need to first setup the Python 3.6 environment: ```pip install -r requirements.txt``` which will install dependencies like [AllenNLP](https://github.com/allenai/allennlp/). Use the `scibert/scripts/train_allennlp_local.sh` script as an example of how to run an experiment (you'll need to modify paths and variable names like `TASK` and `DATASET`). We include a broad set of scientific nlp datasets under the `data/` directory across the following tasks. Each task has a sub-directory of available datasets. ``` β”œβ”€β”€ ner β”‚Β Β  β”œβ”€β”€ JNLPBA β”‚Β Β  β”œβ”€β”€ NCBI-disease β”‚Β Β  β”œβ”€β”€ bc5cdr β”‚Β Β  └── sciie β”œβ”€β”€ parsing β”‚Β Β  └── genia β”œβ”€β”€ pico β”‚Β Β  └── ebmnlp └── text_classification β”œβ”€β”€ chemprot β”œβ”€β”€ citation_intent β”œβ”€β”€ mag β”œβ”€β”€ rct-20k β”œβ”€β”€ sci-cite └── sciie-relation-extraction ``` For example to run the model on the Named Entity Recognition (`NER`) task and on the `BC5CDR` dataset (BioCreative V CDR), modify the `scibert/train_allennlp_local.sh` script according to: ``` DATASET='bc5cdr' TASK='ner' ... ``` Decompress the PyTorch model that you downloaded using `tar -xvf scibert_scivocab_uncased.tar` The results will be in the `scibert_scivocab_uncased` directory containing two files: A vocabulary file (`vocab.txt`) and a weights file (`weights.tar.gz`). Copy the files to your desired location and then set correct paths for `BERT_WEIGHTS` and `BERT_VOCAB` in the script: ``` export BERT_VOCAB=path-to/scibert_scivocab_uncased.vocab export BERT_WEIGHTS=path-to/scibert_scivocab_uncased.tar.gz ``` Finally run the script: ``` ./scibert/scripts/train_allennlp_local.sh [serialization-directory] ``` Where `[serialization-directory]` is the path to an output directory where the model files will be stored. ### Citing If you use `SciBERT` in your research, please cite [SciBERT: Pretrained Language Model for Scientific Text](https://arxiv.org/abs/1903.10676). ``` @inproceedings{Beltagy2019SciBERT, title={SciBERT: Pretrained Language Model for Scientific Text}, author={Iz Beltagy and Kyle Lo and Arman Cohan}, year={2019}, booktitle={EMNLP}, Eprint={arXiv:1903.10676} } ``` `SciBERT` is an open-source project developed by [the Allen Institute for Artificial Intelligence (AI2)](http://www.allenai.org). AI2 is a non-profit institute with the mission to contribute to humanity through high-impact AI research and engineering.

ML Frameworks
1.7K Github Stars
bi-att-flow
Open Source

bi-att-flow

# Bi-directional Attention Flow for Machine Comprehension - This the original implementation of [Bi-directional Attention Flow for Machine Comprehension][paper]. - The CodaLab worksheet for the [SQuAD Leaderboard][squad] submission is available [here][worksheet]. - For TensorFlow v1.2 compatible version, see the [dev][dev] branch. - Please contact [Minjoon Seo][minjoon] ([@seominjoon][minjoon-github]) for questions and suggestions. ## 0. Requirements #### General - Python (verified on 3.5.2. Issues have been reported with Python 2!) - unzip, wget (for running `download.sh` only) #### Python Packages - tensorflow (deep learning library, only works on r0.11) - nltk (NLP tools, verified on 3.2.1) - tqdm (progress bar, verified on 4.7.4) - jinja2 (for visaulization; if you only train and test, not needed) ## 1. Pre-processing First, prepare data. Donwload SQuAD data and GloVe and nltk corpus (~850 MB, this will download files to `$HOME/data`): ``` chmod +x download.sh; ./download.sh ``` Second, Preprocess Stanford QA dataset (along with GloVe vectors) and save them in `$PWD/data/squad` (~5 minutes): ``` python -m squad.prepro ``` ## 2. Training The model has ~2.5M parameters. The model was trained with NVidia Titan X (Pascal Architecture, 2016). The model requires at least 12GB of GPU RAM. If your GPU RAM is smaller than 12GB, you can either decrease batch size (performance might degrade), or you can use multi GPU (see below). The training converges at ~18k steps, and it took ~4s per step (i.e. ~20 hours). Before training, it is recommended to first try the following code to verify everything is okay and memory is sufficient: ``` python -m basic.cli --mode train --noload --debug ``` Then to fully train, run: ``` python -m basic.cli --mode train --noload ``` You can speed up the training process with optimization flags: ``` python -m basic.cli --mode train --noload --len_opt --cluster ``` You can still omit them, but training will be much slower. Note that during the training, the EM and F1 scores from the occasional evaluation are not the same with the score from official squad evaluation script. The printed scores are not official (our scoring scheme is a bit harsher). To obtain the official number, use the official evaluator (copied in `squad` folder, `squad/evaluate-v1.1.py`). For more information See 3.Test. ## 3. Test To test, run: ``` python -m basic.cli ``` Similarly to training, you can give the optimization flags to speed up test (5 minutes on dev data): ``` python -m basic.cli --len_opt --cluster ``` This command loads the most recently saved model during training and begins testing on the test data. After the process ends, it prints F1 and EM scores, and also outputs a json file (`$PWD/out/basic/00/answer/test-####.json`, where `####` is the step # that the model was saved). Note that the printed scores are not official (our scoring scheme is a bit harsher). To obtain the official number, use the official evaluator (copied in `squad` folder) and the output json file: ``` python squad/evaluate-v1.1.py $HOME/data/squad/dev-v1.1.json out/basic/00/answer/test-####.json ``` ### 3.1 Loading from pre-trained weights Instead of training the model yourself, you can choose to use pre-trained weights that were used for [SQuAD Leaderboard][squad] submission. Refer to [this worksheet][worksheet] in CodaLab to reproduce the results. If you are unfamiliar with CodaLab, follow these simple steps (given that you met all prereqs above): 1. Download `save.zip` from the [worksheet][worksheet] and unzip it in the current directory. 2. Copy `glove.6B.100d.txt` from your glove data folder (`$HOME/data/glove/`) to the current directory. 3. To reproduce single model: ``` basic/run_single.sh $HOME/data/squad/dev-v1.1.json single.json ``` This writes the answers to `single.json` in the current directory. You can then use the official evaluator to obtain EM and F1 scores. If you want to run on GPU (~5 mins), change the value of batch_size flag in the shell file to a higher number (60 for 12GB GPU RAM). 4. Similarly, to reproduce ensemble method: ``` basic/run_ensemble.sh $HOME/data/squad/dev-v1.1.json ensemble.json ``` If you want to run on GPU, you should run the script sequentially by removing '&' in the forloop, or you will need to specify different GPUs for each run of the for loop. ## Results ### Dev Data Note these scores are from the official evaluator (copied in `squad` folder, `squad/evaluate-v1.1.py`). For more information See 3.Test. The scores appeared during the training could be lower than the scores from the official evaluator. | | EM (%) | F1 (%) | | -------- |:------:|:------:| | single | 67.7 | 77.3 | | ensemble | 72.6 | 80.7 | ### Test Data | | EM (%) | F1 (%) | | -------- |:------:|:------:| | single | 68.0 | 77.3 | | ensemble | 73.3 | 81.1 | Refer to [our paper][paper] for more details. See [SQuAD Leaderboard][squad] to compare with other models. <!-- ## Using Pre-trained Model If you would like to use pre-trained model, it's very easy! You can download the model weights [here][save] (make sure that its commit id matches the source code's). Extract them and put them in `$PWD/out/basic/00/save` directory, with names unchanged. Then do the testing again, but you need to specify the step # that you are loading from: ``` python -m basic.cli --mode test --batch_size 8 --eval_num_batches 0 --load_step #### ``` --> ## Multi-GPU Training & Testing Our model supports multi-GPU training. We follow the parallelization paradigm described in [TensorFlow Tutorial][multi-gpu]. In short, if you want to use batch size of 60 (default) but if you have 3 GPUs with 4GB of RAM, then you initialize each GPU with batch size of 20, and combine the gradients on CPU. This can be easily done by running: ``` python -m basic.cli --mode train --noload --num_gpus 3 --batch_size 20 ``` Similarly, you can speed up your testing by: ``` python -m basic.cli --num_gpus 3 --batch_size 20 ``` ## Demo For now, please refer to the `demo` branch of this repository. [multi-gpu]: https://www.tensorflow.org/versions/r0.11/tutorials/deep_cnn/index.html#training-a-model-using-multiple-gpu-cards [squad]: http://stanford-qa.com [paper]: https://arxiv.org/abs/1611.01603 [worksheet]: https://worksheets.codalab.org/worksheets/0x37a9b8c44f6845c28866267ef941c89d/ [minjoon]: https://seominjoon.github.io [minjoon-github]: https://github.com/seominjoon [dev]: https://github.com/allenai/bi-att-flow/tree/dev

ML Frameworks
1.5K Github Stars
dolma
Open Source

dolma

<img alt="Dolma's official logo. It's dolma written in yellow, round lowercase letters over a blue background." src="https://raw.githubusercontent.com/allenai/dolma/main/docs/assets/AI2_Blog_1400x685_2x.webp" width="100%"> Dolma is two things: 1. **Dolma Dataset**: an open dataset of 3 trillion tokens from a diverse mix of web content, academic publications, code, books, and encyclopedic materials. 2. **Dolma Toolkit**: a high-performance toolkit for curating datasets for language modeling -- this repo contains the source code for the Dolma Toolkit. ## Dolma Dataset Dolma is an open dataset of 3 trillion tokens from a diverse mix of web content, academic publications, code, books, and encyclopedic materials. It was created as a training corpus for [OLMo](https://allenai.org/olmo), a language model from the [Allen Institute for AI](https://allenai.org) (AI2). Dolma is available for download on the HuggingFace πŸ€— Hub: [`huggingface.co/datasets/allenai/dolma`](https://huggingface.co/datasets/allenai/dolma). Dolma is licensed under **[ODC-BY](https://opendatacommons.org/licenses/by/1-0/)**; see our [blog post](https://blog.allenai.org/making-a-switch-dolma-moves-to-odc-by-8f0e73852f44) for explanation. You can also read more about Dolma in [our announcement](https://blog.allenai.org/dolma-3-trillion-tokens-open-llm-corpus-9a0ff4b8da64), as well as by consulting its [data sheet](docs/assets/dolma-v0_1-20230819.pdf). ## Dolma Toolkit This repository houses the Dolma Toolkit, which enables curation of large datasets for (pre)-training ML models. Its key features are: 1. **High Performance** ⚑: Can process billions of documents concurrently thanks to built-in parallelism. 2. **Portability** 🧳: Works on a single machine, a cluster, or cloud environment. 3. **Built-In Taggers** 🏷: Includes ready-to-use taggers commonly used to curate datasets such as [Gopher](https://arxiv.org/abs/2112.11446), [C4](https://arxiv.org/abs/1910.10683), and [OpenWebText](https://openwebtext2.readthedocs.io/en/latest/). 4. **Fast Deduplication** πŸ—‘: Speedy document deduplication using a Rust Bloom filter. 5. **Extensibility** 🧩 & **Cloud Support** ☁: Supports custom taggers and AWS S3-compatible locations. To install, simply type `pip install dolma` in your terminal. To learn more about how to use the Dolma Toolkit, please visit the [documentation](/docs). ## Citation If you use the Dolma dataset or toolkit, please cite the following items: <!-- {% raw %} --> ```bibtex @article{dolma, title = {{Dolma: An Open Corpus of Three Trillion Tokens for Language Model Pretraining Research}}, author={Luca Soldaini and Rodney Kinney and Akshita Bhagia and Dustin Schwenk and David Atkinson and Russell Authur and Ben Bogin and Khyathi Chandu and Jennifer Dumas and Yanai Elazar and Valentin Hofmann and Ananya Harsh Jha and Sachin Kumar and Li Lucy and Xinxi Lyu and Nathan Lambert and Ian Magnusson and Jacob Morrison and Niklas Muennighoff and Aakanksha Naik and Crystal Nam and Matthew E. Peters and Abhilasha Ravichander and Kyle Richardson and Zejiang Shen and Emma Strubell and Nishant Subramani and Oyvind Tafjord and Pete Walsh and Luke Zettlemoyer and Noah A. Smith and Hannaneh Hajishirzi and Iz Beltagy and Dirk Groeneveld and Jesse Dodge and Kyle Lo}, year={2024}, journal={arXiv preprint}, url={https://arxiv.org/abs/2402.00159} } ``` <!-- {% endraw %} -->

Developer Tools ML Frameworks
1.5K Github Stars
ai2thor
Open Source

ai2thor

<p align="center"><img width="50%" src="https://raw.githubusercontent.com/allenai/ai2thor/main/doc/static/Ai2-THOR.svg" /></p> <h3 align="center"><i>A Near Photo-Realistic Interactable Framework for Embodied AI Agents</i></h3> <p align="center"> <a href="//travis-ci.org/allenai/ai2thor" target="_blank"> <img src="https://travis-ci.org/allenai/ai2thor.svg?branch=main"> </a> <a href="//github.com/allenai/ai2thor/releases"> <img alt="GitHub release" src="https://img.shields.io/github/release/allenai/ai2thor.svg"> </a> <a href="//ai2thor.allenai.org/" target="_blank"> <img alt="Documentation" src="https://img.shields.io/website/https/ai2thor.allenai.org?down_color=red&down_message=offline&up_message=online"> </a> <a href="//github.com/allenai/ai2thor/blob/main/LICENSE"> <img alt="License" src="https://img.shields.io/github/license/allenai/ai2thor.svg?color=blue"> </a> <a href="//arxiv.org/abs/1712.05474" target="_blank"> <img src="https://img.shields.io/badge/arXiv-1712.05474-<COLOR>"> </a> <a href="//www.youtube.com/watch?v=KcELPpdN770" target="_blank"> <img src="https://img.shields.io/badge/video-YouTube-red"> </a> <a href="//pepy.tech/project/ai2thor" target="_blank"> <img alt="Downloads" src="https://pepy.tech/badge/ai2thor"> </a> </p> ## 🏑 Environments <table> <tr> <td width="33%"> <img src="https://user-images.githubusercontent.com/28768645/115940549-d0134a80-a456-11eb-8737-d89ad75a0f14.jpg" width="100%" /> </td> <td width="33%"> <img src="https://user-images.githubusercontent.com/28768645/115940534-c689e280-a456-11eb-985a-ca28e63715c7.jpg" width="100%" /> </td> <td width="33%"> <img src="https://user-images.githubusercontent.com/28768645/115940466-8b87af00-a456-11eb-92e5-25a9f28e7f6b.jpg" width="100%" /> </td> </tr> <tr> <td align="center" width="33%"> <code>iTHOR</code> </td> <td align="center" width="33%"> <code>ManipulaTHOR</code> </td> <td align="center" width="33%"> <code>RoboTHOR</code> </td> </tr> <tr> <td width="33%"> A high-level interaction framework that facilitates research in embodied common sense reasoning. </td> <td width="33%"> A mid-level interaction framework that facilitates visual manipulation of objects using a robotic arm. </td> <td width="33%"> A framework that facilitates Sim2Real research with a collection of simulated scene counterparts in the physical world. </td> </tr> </table> ## 🌍 Features **🏑 Scenes.** 200+ custom built high-quality scenes. The scenes can be explored on our [demo](//ai2thor.allenai.org/demo) page. We are working on rapidly expanding the number of available scenes and domain randomization within each scene. **πŸͺ‘ Objects.** 2600+ custom designed household objects across 100+ object types. Each object is heavily annotated, which allows for near-realistic physics interaction. **πŸ€– Agent Types.** Multi-agent support, a custom built LoCoBot agent, a Kinova 3 inspired robotic manipulation agent, and a drone agent. **🦾 Actions.** 200+ actions that facilitate research in a wide range of interaction and navigation based embodied AI tasks. **πŸ–Ό Images.** First-class support for many image modalities and camera adjustments. Some modalities include ego-centric RGB images, instance segmentation, semantic segmentation, depth frames, normals frames, top-down frames, orthographic projections, and third-person camera frames. User's can also easily change camera properties, such as the size of the images and field of view. **πŸ—Ί Metadata.** After each step in the environment, there is a large amount of sensory data available about the state of the environment. This information can be used to build highly complex custom reward functions. ## πŸ“° Latest Announcements <table> <tr> <td align="center" width="80"> Date </td> <td align="center" colspan="2"> Announcement </td> </tr> <tr> <td align="center"> 5/2021 </td> <td width="50%"> <video src="https://user-images.githubusercontent.com/28768645/118589971-58cf8e80-b756-11eb-82ea-a94f84f57353.mp4"/> </td> <td> <code>RandomizeMaterials</code> is now supported! It enables a massive amount of realistic looking domain randomization within each scene. Try it out on the <a href="https://ai2thor.allenai.org/demo">demo</a> </td> </tr> <tr> <td align="center"> 4/2021 </td> <td colspan="2"> We are excited to release <a href="https://ai2thor.allenai.org/manipulathor/">ManipulaTHOR</a>, an environment within the AI2-THOR framework that facilitates visual manipulation of objects using a robotic arm. Please see the <a href="https://github.com/allenai/ai2thor/blob/main/doc/static/ReleaseNotes/ReleaseNotes_3.0.md">full 3.0.0 release notes here</a>. </td> </tr> <tr> <td align="center"> 4/2021 </td> <td width="50%"> <video src="https://user-images.githubusercontent.com/28768645/118590040-7a307a80-b756-11eb-9b4c-c43373bea528.mp4"></video> <video src="https://user-images.githubusercontent.com/28768645/118589727-d1821b00-b755-11eb-9dff-9eda97fe0998.mp4"></video> </td> <td> <code>RandomizeLighting</code> is now supported! It includes many tunable parameters to allow for vast control over its effects. Try it out on the <a href="https://ai2thor.allenai.org">demo</a>!<br/><br/> </td> </tr> <tr> <td align="center"> 2/2021 </td> <td colspan="2"> We are excited to host the <a href="https://ai2thor.allenai.org/rearrangement/">AI2-THOR Rearrangement Challenge</a>, <a href="https://ai2thor.allenai.org/robothor/cvpr-2021-challenge/">RoboTHOR ObjectNav Challenge</a>, and <a href="https://askforalfred.com/EAI21/">ALFRED Challenge</a>, held in conjunction with the <a href="https://embodied-ai.org/">Embodied AI Workshop</a> at CVPR 2021. </td> </tr> <tr> <td align="center"> 2/2021 </td> <td colspan="2"> AI2-THOR v2.7.0 announces several massive speedups to AI2-THOR! Read more about it <a href="https://medium.com/ai2-blog/speed-up-your-training-with-ai2-thor-2-7-0-12a650b6ab5e">here</a>. </td> </tr> <tr> <td align="center"> 6/2020 </td> <td colspan="2"> We've released <a href="https://github.com/allenai/ai2thor-docker">🐳 AI2-THOR Docker</a> a mini-framework to simplify running AI2-THOR in Docker. </td> </tr> <tr> <td align="center"> 4/2020 </td> <td colspan="2"> Version 2.4.0 update of the framework is here. All sim objects that aren't explicitly part of the environmental structure are now moveable with physics interactions. New object types have been added, and many new actions have been added. Please see the <a href="https://github.com/allenai/ai2thor/blob/main/doc/static/ReleaseNotes/ReleaseNotes_2.4.md">full 2.4.0 release notes here</a>. </td> </tr> <tr> <td align="center"> 2/2020 </td> <td colspan="2"> AI2-THOR now includes two frameworks: <a href="https://ai2thor.allenai.org/ithor/">iTHOR</a> and <a href="https://ai2thor.allenai.org/robothor/">RoboTHOR</a>. iTHOR includes interactive objects and scenes and RoboTHOR consists of simulated scenes and their corresponding real world counterparts. </td> </tr> <tr> <td align="center"> 9/2019 </td> <td colspan="2"> Version 2.1.0 update of the framework has been added. New object types have been added. New Initialization actions have been added. Segmentation image generation has been improved in all scenes. </td> </tr> <tr> <td align="center"> 6/2019 </td> <td colspan="2"> Version 2.0 update of the AI2-THOR framework is now live! We have over quadrupled our action and object states, adding new actions that allow visually distinct state changes such as broken screens on electronics, shattered windows, breakable dishware, liquid fillable containers, cleanable dishware, messy and made beds and more! Along with these new state changes, objects have more physical properties like Temperature, Mass, and Salient Materials that are all reported back in object metadata. To combine all of these new properties and actions, new context sensitive interactions can now automatically change object states. This includes interactions like placing a dirty bowl under running sink water to clean it, placing a mug in a coffee machine to automatically fill it with coffee, putting out a lit candle by placing it in water, or placing an object over an active stove burner or in the fridge to change its temperature. Please see the <a href="https://github.com/allenai/ai2thor/blob/main/doc/static/ReleaseNotes/ReleaseNotes_2.0.md">full 2.0 release notes here</a> to view details on all the changes and new features. </td> </tr> </table> ## πŸ’» Installation ### With Google Colab [AI2-THOR Colab](https://github.com/allenai/ai2thor-colab) can be used to run AI2-THOR freely in the cloud with Google Colab. Running AI2-THOR in Google Colab makes it extremely easy to explore functionality without having to set AI2-THOR up locally. ### With pip ```bash pip install ai2thor ``` ### With conda ```bash conda install -c conda-forge ai2thor ``` ### With Docker [🐳 AI2-THOR Docker](https://github.com/allenai/ai2thor-docker) can be used, which adds the configuration for running a X server to be used by Unity 3D to render scenes. ### Minimal Example Once you've installed AI2-THOR, you can verify that everything is working correctly by running the following minimal example: ```python from ai2thor.controller import Controller controller = Controller(scene="FloorPlan10") event = controller.step(action="RotateRight") metadata = event.metadata print(event, event.metadata.keys()) ``` ### Requirements | Component | Requirement | | :-- | :-- | | OS | Mac OS X 10.9+, Ubuntu 14.04+ | | Graphics Card | DX9 (shader model 3.0) or DX11 with feature level 9.3 capabilities. | | CPU | SSE2 instruction set support. | | Python | Versions 3.5+ | | Linux | X server with GLX module enabled | ## πŸ’¬ Support **Questions.** If you have any questions on AI2-THOR, please ask them on our [GitHub Discussions Page](https://github.com/allenai/ai2thor/discussions). **Issues.** If you encounter any issues while using AI2-THOR, please open an [Issue on GitHub](https://github.com/allenai/ai2thor/issues). ## 🏫 Learn more | Section | Description | | :-- | :-- | | [Demo](https://ai2thor.allenai.org/demo/) | Interact and play with AI2-THOR live in the browser. | | [iTHOR Documentation](https://ai2thor.allenai.org/ithor/documentation/) | Documentation for the iTHOR environment. | | [ManipulaTHOR Documentation](https://ai2thor.allenai.org/manipulathor/documentation/) | Documentation for the ManipulaTHOR environment. | | [RoboTHOR Documentation](https://ai2thor.allenai.org/robothor/documentation/) | Documentation for the RoboTHOR environment. | | [AI2-THOR Colab](https://github.com/allenai/ai2thor-colab) | A way to run AI2-THOR freely on the cloud using Google Colab. | | [AllenAct](https://allenact.org/) | An Embodied AI Framework build at AI2 that provides first-class support for AI2-THOR. | | [AI2-THOR Unity Development](https://github.com/allenai/ai2thor/tree/main/unity#readme) | A (sparse) collection of notes that may be useful if editing on the AI2-THOR backend. | | [AI2-THOR WebGL Development](https://github.com/allenai/ai2thor/blob/main/WEBGL.md) | Documentation on packaging AI2-THOR for the web, which might be useful for annotation based tasks. | ## πŸ“’ Citation If you use AI2-THOR or iTHOR scenes, please cite the original AI2-THOR paper: ```bibtex @article{ai2thor, author={Eric Kolve and Roozbeh Mottaghi and Winson Han and Eli VanderBilt and Luca Weihs and Alvaro Herrasti and Daniel Gordon and Yuke Zhu and Abhinav Gupta and Ali Farhadi}, title={{AI2-THOR: An Interactive 3D Environment for Visual AI}}, journal={arXiv}, year={2017} } ``` If you use 🏘️ ProcTHOR or procedurally generated scenes, please cite the following paper: ```bibtex @inproceedings{procthor, author={Matt Deitke and Eli VanderBilt and Alvaro Herrasti and Luca Weihs and Jordi Salvador and Kiana Ehsani and Winson Han and Eric Kolve and Ali Farhadi and Aniruddha Kembhavi and Roozbeh Mottaghi}, title={{ProcTHOR: Large-Scale Embodied AI Using Procedural Generation}}, booktitle={NeurIPS}, year={2022}, note={Outstanding Paper Award} } ``` If you use ManipulaTHOR agent, please cite the following paper: ```bibtex @inproceedings{manipulathor, title={{ManipulaTHOR: A Framework for Visual Object Manipulation}}, author={Kiana Ehsani and Winson Han and Alvaro Herrasti and Eli VanderBilt and Luca Weihs and Eric Kolve and Aniruddha Kembhavi and Roozbeh Mottaghi}, booktitle={CVPR}, year={2021} } ``` If you use RoboTHOR scenes, please cite the following paper: ```bibtex @inproceedings{robothor, author={Matt Deitke and Winson Han and Alvaro Herrasti and Aniruddha Kembhavi and Eric Kolve and Roozbeh Mottaghi and Jordi Salvador and Dustin Schwenk and Eli VanderBilt and Matthew Wallingford and Luca Weihs and Mark Yatskar and Ali Farhadi}, title={{RoboTHOR: An Open Simulation-to-Real Embodied AI Platform}}, booktitle={CVPR}, year={2020} } ``` ## πŸ‘‹ Our Team AI2-THOR is an open-source project built by the [PRIOR team](//prior.allenai.org) at the [Allen Institute for AI](//allenai.org) (AI2). AI2 is a non-profit institute with the mission to contribute to humanity through high-impact AI research and engineering. <br /> <a href="//prior.allenai.org"> <p align="center"><img width="100%" src="https://raw.githubusercontent.com/allenai/ai2thor/main/doc/static/ai2-prior.svg" /></p> </a>

Game Development ML Frameworks
1.7K Github Stars
objaverse-xl
Open Source

objaverse-xl

# πŸͺ Objaverse-XL This repository contains scripts to download and process Objaverse-XL. <img src="https://mattdeitke.com/static/1cdcdb2ef7033e177ca9ae2975a9b451/9c1ca/objaverse-xl.webp"> Objaverse-XL is an open dataset of over 10 million 3D objects! With it, we train Zero123-XL, a foundation model for 3D, observing incredible 3D generalization abilities: πŸ§΅πŸ‘‡ ## Scale Comparison Objaverse 1.0 was released back in December. It was a step in the right direction, but still relatively small with 800K objects. Objaverse-XL is over an order of magnitude larger and much more diverse! <img src="https://github.com/allenai/objaverse-rendering/assets/28768645/43833dd3-ec97-4a3d-8782-00a6aea584b4"> ## Unlocking Generalization Compared to the original Zero123 model, Zero123-XL improves remarkably in 0-shot generalization abilities, even being able to perform novel view synthesis on sketches, cartoons, and people! A ton more examples in the [πŸ“ paper](https://arxiv.org/abs/2307.05663) :) <img src="https://github.com/allenai/objaverse-rendering/assets/28768645/8470e4df-e39d-444b-9871-58fbee4b87fd"> ## Image β†’ 3D With the base Zero123-XL foundation model, we can perform image β†’ 3D using [DreamFusion](https://dreamfusion3d.github.io/), having the model guide a NeRF to generate novel views! https://github.com/allenai/objaverse-rendering/assets/28768645/571852cd-dc02-46ce-b2bb-88f64a67d0ac ## Text β†’ 3D Text-to-3D comes for free with text β†’ image models, such as with SDXL here, providing the initial image! https://github.com/allenai/objaverse-rendering/assets/28768645/96255b42-8158-4c7a-8308-7b0f1257ada8 ## Scaling Trends Beyond that, we show strong scaling trends for both Zero123-XL and [PixelNeRF](https://alexyu.net/pixelnerf/)! <img src="https://github.com/allenai/objaverse-rendering/assets/28768645/0c8bb433-27df-43a1-8cb8-1772007c0899"> ## Tutorial Check out the [Google Colab tutorial](https://colab.research.google.com/drive/15XpZMjrHXuky0IgBbXcsUtb_0g-XWYmN?usp=sharing) to download Objaverse-XL . Polycam data is available by Polycam to academic researchers for non-commercial use upon request and approval from Polycam. For access please fill out [this form](https://forms.gle/HUjYVtS9GKVS5QBXA). ## Blender Rendering Blender rendering scripts are available in the [scripts/rendering directory](https://github.com/allenai/objaverse-xl/tree/main/scripts/rendering)! ![266879371-69064f78-a752-40d6-bd36-ea7c15ffa1ec](https://github.com/allenai/objaverse-xl/assets/28768645/2f042d94-090b-4fd0-b37d-23b5971987ed) ## License The use of the dataset as a whole is licensed under the ODC-By v1.0 license. Individual objects in Objaverse-XL are licensed under different licenses. ## Citation To cite Objaverse-XL, please cite our [πŸ“ arXiv](https://arxiv.org/abs/2307.05663) paper with the following BibTeX entry: ```bibtex @article{objaverseXL, title={Objaverse-XL: A Universe of 10M+ 3D Objects}, author={Matt Deitke and Ruoshi Liu and Matthew Wallingford and Huong Ngo and Oscar Michel and Aditya Kusupati and Alan Fan and Christian Laforte and Vikram Voleti and Samir Yitzhak Gadre and Eli VanderBilt and Aniruddha Kembhavi and Carl Vondrick and Georgia Gkioxari and Kiana Ehsani and Ludwig Schmidt and Ali Farhadi}, journal={arXiv preprint arXiv:2307.05663}, year={2023} } ``` Objaverse 1.0 is available on πŸ€—Hugging Face at [@allenai/objaverse](https://huggingface.co/datasets/allenai/objaverse). To cite it, use: ```bibtex @article{objaverse, title={Objaverse: A Universe of Annotated 3D Objects}, author={Matt Deitke and Dustin Schwenk and Jordi Salvador and Luca Weihs and Oscar Michel and Eli VanderBilt and Ludwig Schmidt and Kiana Ehsani and Aniruddha Kembhavi and Ali Farhadi}, journal={arXiv preprint arXiv:2212.08051}, year={2022} } ```

ML Frameworks 3D Modeling & Animation
1.3K Github Stars