Giter Site home page Giter Site logo

stanfordnlprestapi's People

Contributors

jplu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ovarene

stanfordnlprestapi's Issues

Fix README

The README file needs to be cleaned up (typos, links for collaborators, better phrasing)

Better Dockerfile handling

The current version of the Dockerfile need to be modified everytime the version changes. Find a way to compile the project directly when building the Docker image.

setupenv.py is Python2 only

Here is a possible solution that should work with both Python2 and 3 :

try:
    from urllib2 import urlopen
except ImportError: # Python 3
    from urllib.request import urlopen
import zipfile
import progressbar

url = "http://adel.eurecom.fr/data/models-gazetteers-properties.zip"
bar = progressbar.ProgressBar()
file_name = url.split('/')[-1]
u = urlopen(url)

with open(file_name, 'wb') as f:
    file_size =  int(u.headers['Content-Length'])

    print("Downloading: %s Bytes: %s" % (file_name, file_size))

    for i in bar(range(0, file_size, 8192)):
        buffer = u.read(8192)

        if not buffer:
            break

        f.write(buffer)

print("Unzip " + file_name)

zip_ref = zipfile.ZipFile("models-gazetteers-properties.zip")
number_files = len(zip_ref.infolist())

bar.update(0)

for i in bar(range(number_files)):
    zip_ref.extract(zip_ref.infolist()[i])

zip_ref.close()

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.