https://github.com/wtnabe/example-simple-vector-search-with-annoy-rb
https://github.com/wtnabe/example-simple-vector-search-with-annoy-rb
annoy latlng ruby vector-search
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/wtnabe/example-simple-vector-search-with-annoy-rb
- Owner: wtnabe
- License: bsd-2-clause
- Created: 2024-01-08T09:46:33.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-08T13:32:05.000Z (over 1 year ago)
- Last Synced: 2025-01-12T18:10:03.905Z (9 months ago)
- Topics: annoy, latlng, ruby, vector-search
- Language: Ruby
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## annoy-rbを用いた最も身近で最も素朴なベクトル検索の練習
### 準備するもの
* Ruby
* [yoshoku/annoy\-rb: annoy\-rb provides Ruby bindings for the Annoy \(Approximate Nearest Neighbors Oh Yeah\)\.](https://github.com/yoshoku/annoy-rb)### できること
日本国内の各都道府県の人口上位3都市(ChatGPT調べ)の緯度経度を持つデータベースから、与えた緯度経度に近い順に都市を列挙する
### 使い方
全部ターミナルで頑張って😉
1. install dependencies
```
$ bundle install
```2. prepare annoy index
```
$ bundle exec ruby app.rb prepare
```3. search longitude, latitude
copy longitude and latitude from Google Maps, etc...
```
$ bundle exec ruby app.rb 36.561126595665904, 136.65658579973413
```### 注意
1. 自分の身近な場所を題材にするとそりゃそうだという結果しか得られないので面白くない🙃
2. 各都市の緯度軽度の情報は嘘が紛れている可能性がありますというか、2024-01-08 生成時点で石川県松任市が含まれているので、あくまで雰囲気で楽しむこと