Edit model card
YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Model card for CoNN Reverse

Introduction

In paper Neural Comprehension: Language Models with Compiled Neural Networks , we introduced the integration of Compiled Neural Networks (CoNN) into the framework of language models, enabling existing language models to perform symbolic operations with perfect accuracy without the need for external tools. In this model card, we introduce the Reverse model, which is similar to the Transformer model and can reverse the input text.

Install

git clone https://github.com/WENGSYX/Neural-Comprehension
cd Neural-Comprehension
pip install .

To run neural comprehension, you need to install PyTorch, Transformers, jax, and tracr.

How to Use?

from NeuralCom.CoNN.modeling_conn import CoNNModel
from NeuralCom.CoNN import Tokenizer


model = CoNNModel.from_pretrained('WENGSYX/CoNN_Reverse')
tokenizer = Tokenizer(model.config.input_encoding_map, model.config.output_encoding_map,model.config.max_position_embeddings)

output = model(tokenizer('r e v e r s e').unsqueeze(0))
print(tokenizer.decode(output.argmax(2)))
>>> [['bos', 'e', 's', 'r', 'e', 'v', 'e', 'r']]

๐Ÿ™Cite๐Ÿ™

If you are interested in our paper, please feel free to cite it.
@misc{weng2023neural,
      title={Neural Comprehension: Language Models with Compiled Neural Networks}, 
      author={Yixuan Weng and Minjun Zhu and Fei Xia and Bin Li and Shizhu He and Kang Liu and Jun Zhao},
      year={2023},
      eprint={2304.01665},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
Downloads last month
4
Inference API
Unable to determine this modelโ€™s pipeline type. Check the docs .