-
Use GloVe to produce vector data
- This will produce the vectors.txt and vectors.bin data
-
Use
main.pyto produce a new "vectors only" spacy model by usingen_core_web_mdas the base -
Once this finishes, run
spacy package inDir outDirwithinDir, outDirset toModelInputDir,WhateverOutputDirrespectively.- This step will create a package that can be readily used by spacy.
-
From within
WhateverOutputDir, executepip install -e ./to install the model as a module.
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
| """ | |
| This is a module that is supposed to be describing the whole datamodel of an application. | |
| NOTE: The directory structure that is implied here is: | |
| src/ | |
| app_models/ | |
| __init__.py (THIS FILE) | |
| main.py | |
| """ |
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 neomodel | |
| class Item(neomodel.StructuredNode): | |
| __primarykey__ = "name" | |
| name = neomodel.StringProperty(unique_index=True) |
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
| '''Athanasios Anastasiou June 2017 | |
| Reads a bib file and exports the 'publications' entry to be attached to some jsonResume file''' | |
| import pybtex.database | |
| import sys | |
| import json | |
| def formatEntry(anEntry): | |
| '''Returns a dictionary with the required entries by the jsonresume schema''' | |
| pubTitle = anEntry.fields['journal'] if 'journal' in anEntry.fields.keys() else anEntry.fields['booktitle'] if 'booktitle' in anEntry.fields.keys() else ""; | |
| return {"name":anEntry.fields['title'].replace("{","").replace("}","").replace("\&","\&"), |
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
| '''Athanasios Anastasiou 13/12/2015 | |
| A simple function to get the "upper" and "lower" values envelope | |
| from a time series''' | |
| from numpy import array, sign, zeros | |
| from scipy.interpolate import interp1d | |
| from matplotlib.pyplot import plot,show,hold,grid, xlabel, ylabel, title, figure | |
| def getEnvelopeModels(aTimeSeries, rejectCloserThan = 0): | |
| '''Fits models to the upper and lower envelope peaks and troughs. |
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
| #@author:Athanasios Anastasiou | |
| #@date: Wed Jul 29 10:44:08 2015 | |
| import networkx #Graph module | |
| import pynq #LINQ for Python module | |
| from matplotlib import pyplot as plt #Fancy drawing stuff | |
| import random #The standard oamdrn module | |
| from collections import namedtuple #A named tuple to make pynq think it's going over a collection of classes. | |
| #SETUP THE SCHEMA | |
| #Notice the notion of references back to the original schema inspired by the property graph model (https://github.com/tinkerpop/blueprints/wiki/Property-Graph-Model) |
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
| #Edge contraction as per http://en.wikipedia.org/wiki/Edge_contraction | |
| def contract_edges(G,nodes, new_node, attr_dict=None, **attr): | |
| '''Contracts the edges of the nodes in the set "nodes" ''' | |
| #Add the node with its attributes | |
| G.add_node(new_node, attr_dict, **attr) | |
| #Create the set of the edges that are to be contracted | |
| cntr_edge_set = G.edges(nodes, data = True) | |
| #Add edges from new_node to all target nodes in the set of edges that are to be contracted | |
| #Possibly also checking that edge attributes are preserved and not overwritten, |
This little project defines a function that can be used to construct a Cypher query which when executed against a Neo4j database server will store the graph to the server.
- A Graph is an abstract mathematical model composed of Nodes connected through Edges that can be used to describe complex systems composed of a set of parts (corresponding to nodes) and their connections (corresponding to edges).
- Examples of graphs are road networks (junctions connected via roads), electronic circuit networks (components and their connections) and others
- Networkx is an excellent Python module for manipulating such Graph objects of any kind.
- Neo4j is a graph database. It uses the Graph as a data model to store such objects to a data store.
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
| """A very simple example to show what is required to get the excellent deform module from the Pylon's project to work with Flask. | |
| DeForm is a Pylon's module capable of automatically creating HTML forms that conform to a schema of classes defined in Python through the Colander module. The transformation between Schema<-->Form data is handled by another module called Peppercorn. More information about how these three modules work together can be found at: http://docs.pylonsproject.org/projects/deform/en/latest/?awesome | |
| Although DeForm is a Pylon's project, it can also operate as a stand-alone module. This Gist contains all the necessary changes to objects provided by Flask so that DeForm can serialize and deserialize data posted through a Flask.Request. | |
| The basic thing that this gist is trying to demonstrate is how to derive from a Flask.Request object in order to change the data type of the Flask.Request.form object that stores the data posted by the client to the server. By default, Flask uses a MultiDict i |
NewerOlder