This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # curl -L mini.conda.ml | bash | |
| source ~/.bash_profile | |
| conda create --name nlp python=3.6 | |
| source ~/.bash_profile | |
| conda activate nlp | |
| pip install spacy | |
| conda install tensorflow | |
| conda install -c pandas | |
| conda install -c jupyter | |
| pip install textacy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import xml.etree.ElementTree as ET | |
| import pandas as pd | |
| tree = ET.parse('Restaurants_Train.xml') | |
| root = tree.getroot() | |
| labeled_reviews = [] | |
| for sentence in root.findall("sentence"): | |
| entry = {} | |
| if sentence.find("aspectTerms"): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '4' | |
| # As of JanusGraph 0.4.0, up to Cassandra 3.11 and Elasticsearch 6.x | |
| # are supported. | |
| # | |
| # Here's the compatibility matrix: | |
| # https://docs.janusgraph.org/latest/version-compat.html | |
| # | |
| # Here's the compatibility data for ScyllaDB: | |
| # http://docs.scylladb.com/using-scylla/cassandra-compatibility/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from multiprocessing import Pool | |
| from multiprocessing import cpu_count | |
| def f(x): | |
| while True: | |
| x*x | |
| if __name__ == '__main__': | |
| processes = cpu_count() | |
| pool = Pool(processes) |
OlderNewer