README.md in hanny-0.1.0 vs README.md in hanny-0.2.0
- old
+ new
@@ -1,11 +1,12 @@
# Hanny
-[![Build Status](https://travis-ci.org/yoshoku/Hanny.svg?branch=master)](https://travis-ci.org/yoshoku/Hanny)
-[![Coverage Status](https://coveralls.io/repos/github/yoshoku/Hanny/badge.svg?branch=master)](https://coveralls.io/github/yoshoku/Hanny?branch=master)
+[![Build Status](https://github.com/yoshoku/hanny/actions/workflows/build.yml/badge.svg)](https://github.com/yoshoku/hanny/actions/workflows/build.yml)
+[![Coverage Status](https://coveralls.io/repos/github/yoshoku/hanny/badge.svg?branch=main)](https://coveralls.io/github/yoshoku/hanny?branch=main)
[![Gem Version](https://badge.fury.io/rb/hanny.svg)](https://badge.fury.io/rb/hanny)
-[![BSD 2-Clause License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://github.com/yoshoku/Hanny/blob/master/LICENSE.txt)
+[![BSD 2-Clause License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://github.com/yoshoku/Hanny/blob/main/LICENSE.txt)
+[![Documentation](https://img.shields.io/badge/api-reference-blue.svg)](https://yoshoku.github.io/hanny/doc/)
Hanny is a Hash-based Approximate Nearest Neighbor (ANN) search library in Ruby.
Hash-based ANN converts vector data into binary codes and builds a hash table by using the binary codes as hash keys.
To build the hash table, Hanny uses Locality Sensitive Hashing (LSH) of approximating cosine similarity.
It is known that if the code length is sufficiently long (ex. greater than 128-bit), LSH can obtain high search performance.
@@ -25,10 +26,14 @@
Or install it yourself as:
$ gem install hanny
+## Documentation
+
+- [Hanny API Documentation](https://yoshoku.github.io/hanny/doc/)
+
## Usage
```ruby
require 'hanny'
@@ -65,18 +70,18 @@
I confirmed the search speed of Hanny's LSH with [MNIST](https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass.html#mnist) data set.
The experiment is carried out on MacBook Early 2016 (Core m3 1.1 GHz CPU and 8 GB memory).
Code:
+
```ruby
require 'benchmark'
-require 'svmkit'
+require 'rumale'
require 'hanny'
# Load MNIST data set.
-samples, labels = SVMKit::Dataset.load_libsvm_file('mnist')
-samples = Numo::DFloat.cast(samples)
+samples, labels = Rumale::Dataset.load_libsvm_file('mnist')
queries = samples[0..5, true]
targets = samples[6..-1, true]
qlabels = labels[0..5]
tlabels = labels[6..-1]
@@ -109,10 +114,11 @@
end
end
```
Result:
+
```bash
user system total real
LSH
query label: 5, neighbors label: 5, 5, 5, 5, 5,
query label: 0, neighbors label: 0, 0, 0, 0, 0,
@@ -129,22 +135,16 @@
query label: 9, neighbors label: 9, 9, 9, 9, 9,
query label: 2, neighbors label: 2, 2, 2, 2, 2,
6.350000 0.280000 6.630000 ( 6.682365)
```
-## Development
-
-After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
-
-To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
-
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/yoshoku/Hanny. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [BSD 2-clause License](https://opensource.org/licenses/BSD-2-Clause).
## Code of Conduct
-Everyone interacting in the Hanny project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yoshoku/Hanny/blob/master/CODE_OF_CONDUCT.md).
+Everyone interacting in the Hanny project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yoshoku/Hanny/blob/main/CODE_OF_CONDUCT.md).