# Code for "Unsupervised and Supervised Co-learning for Codebase Mining and its Application in Code Search"
This repo contains the source code introduced in our paper. 

# Comment-based Codebase Refining (COCORF)

``COCORF`` is a Python3 library for filtering query-appropriate text to build high-quality code search datasets.
It consists of two filters: a rule-based filer and a model-based filter (Pytorch required).
Currently, ``COCORF`` should be used with GPU-enabled Pytorch.

## Installation
We have uploaded ``COCORF`` to Python Package Index (PyPi) and you can install it by the following command:
```
pip install cocorf
```

You can also clone this repo and install directly with the following command:

```
pip install -r requirements.txt
python setup.py install
```

Besides, ``COCORF`` should be used with GPU-enabled Pytorch. You can refer to https://pytorch.org/get-started/locally/ to install Pytorch. Pytorch 1.3 is required (Pytorch 1.3 does not support Python 3.8+).