Skip to content

Pythonで作るWebクローラ・検索エンジン

Notifications You must be signed in to change notification settings

outpark/SearchEngine

 
 

Repository files navigation

Pythonで作る検索エンジン

Description

スクリーンショット 2014-11-11 22.49.07.png

勉強用に作った検索エンジン。やったことは以下のとおり。

  • Webクローラの構築
  • Mecabで日本語の形態素解析
  • 検索エンジンの構築
  • データをMongoDBに格納
  • FlaskでWebアプリ作成

詳しくはブログのほうに書きます(Programming Log)。

Requirements

  • Python 2.7
  • pip
  • MeCab

Setup

  1. Clone repository

    $ git clone git@github.com:mejiro/SearchEngine.git
    
  2. Install Mecab

    $ # MeCab
    $ brew install mecab mecab-ipadic
    $ # Python binding
    $ wget https://mecab.googlecode.com/files/mecab-python-0.996.tar.gz
    $ workon search_engine
    $ pip install mecab-python-0.996.tar.gz # これでいれれる!
    $ rm mecab-python-0.996.tar.gz
    
    参考

    Homebrew + Virtualenv 環境でMeCabのインストール : さりんじゃーのプログラミング日記

  3. Install python packages

    $ cd SearchEngine
    $ pip install -r requirements.txt
    
  4. MongoDB settings

    Please rewrite MONGO_URL in settings.py

  5. Run

    $ python run-crawler.py # build a index
    $ python run-webapp.py # access to http://127.0.0.1:5000
    

Project Structure

$ tree .
.
├── README.md
├── config.py
├── requirements.txt
├── run-crawler.py
├── run-webapp.py
├── search_engine
│   ├── __init__.py
│   ├── static
│   ├── templates
│   │   └── index.html
│   └── views.py
└── web_crawler
    ├── __init__.py
    ├── crawler.py
    └── drop_collection.py

About

Pythonで作るWebクローラ・検索エンジン

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 74.4%
  • HTML 25.6%