Git Product home page Git Product logo

image-caption-metrics's Introduction

image-caption-metrics

a py3 lib for NLP & image-caption metrics : BLEU METEOR CIDEr ROUGE SPICE WMD

Features below:

  • python3 support
  • add new metric WMD

Requirements

  • java 1.8+

  • python 3 (Python2 has not been tested)

    • gensim
  • Stanford CoreNLP 3.6.0(download)

    • add stanford-corenlp-3.6.0.jar to pycocoevalcap/spice/lib/
    • add stanford-corenlp-3.6.0-models.jar to pycocoevalcap/spice/lib/
  • google_word2vec_model for WMD(download)

    • unzip it and add GoogleNews-vectors-negative300.bin to pycocoevalcap/wmd/data

Usage

See in demo.py

  • Note that the input format must be the same as the file in examples/gts.json and examples/res.json
  • It seems can't run in windows(error about java), run it on Linux
import pycocoevalcap.eval as E

with open('examples/gts.json', 'r') as f: 
    gts = json.load(f)
with open('examples/res.json', 'r') as f:
    res = json.load(f)
    
ans = E.eval(gts,tes)
print(ans)
bleu = E.get_bleu(gts,res)
print(bleu)
cider = E.get_cider(gts,res)
print(cider)

References

image-caption-metrics's People

Contributors

ericwwww avatar hcwei13 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.