Skip to content

UDICatNCHU/PMI-of-KCM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PMI of KCM

Use Pointwise mutual information (PMI), or point mutual information to

Install

Manually Install

If you want to integrate PMIofKCM into your own django project, use manually install.

  • pip install PMIofKCM

Config

  1. add django app PMIofKCM in settings.py
  • add this:

    INSTALLED_APPS=[
    ...
    ...
    ...
    'PMIofKCM',
    ]
  1. add url patterns of PMIofKCM into urls.py
  • add this:

    # pmiOfKcm
    import PMIofKCM.urls
    urlpatterns += [
        url(r'^pmi/', include(PMIofKCM.urls))
    ]
  1. use python3 manage.py buildPMI --lang <lang, e.g., zh or en or th> to build model of PMIofKCM.
  2. fire python manage.py runserver and go 127.0.0.1:8000/ to check whether the config is all ok.

API

  1. the result of querying pmi model with keyword 歐洲足球會協會(Captain America):/pmi
  • keyword

  • num (default=10)

  • keyFlag (default=[])

  • valueFlag (defualt=[])

  • example1:http://udiclab.cs.nchu.edu.tw/pmi/?keyword=歐洲足球會協會&lang=zh

    {
      "value": [
        [
          "足協",
          182.54887901332577
        ],
        [
          "歐洲足球",
          164.40832185981395
        ],
        [
          "成員國",
          160.17033554655106
        ],
        [
          "會員",
          155.96658603881642
        ],
        [
          "歐洲",
          155.04907093836462
        ],
        [
          "UEFA",
          151.3463095860187
        ]
      ],
      "similarity": 1,
      "key": "歐洲足球會協會"
    }

Deployment

PMIofKCM is a django-app, so depends on django project.

Built With

  • python3.5
  • pymongo

Contributors

  • 陳聖軒
  • 張泰瑋 david

License

This package use GPL3.0 License.

About

一個依附在KCM上的PMI模組

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages