repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
nmap-generation | nmap-generation-main/generators/utils.py | import enum
from math import ceil
from tokenize import Number
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
def show_images(images, max_row=None):
num_images = len(images)
fig, axes = None, None
if max_row:
fig, axes = plt.subplots(ncols=max_row, nrows=ceil(num_images/max_ro... | 1,405 | 21.677419 | 79 | py |
nmap-generation | nmap-generation-main/generators/multiangle_generator.py | from tkinter import image_names
from skimage.io import imread
from skimage.color import rgba2rgb, rgb2gray
import numpy as np
from generator import Generator
from utils import rescale_0to1, show_images
class MultiangleGenerator(Generator):
def __init__(self):
super().__init__(
folder='D:/git/n... | 3,343 | 31.466019 | 91 | py |
nmap-generation | nmap-generation-main/generators/sobel_filter.py | from utils import overwrite_channel, normalize_img, rescale_0to1
import numpy as np
from scipy.signal import convolve2d as conv2d
def merge_gradients(sobel_v, sobel_h, intensity=1.0):
out_height, out_width = sobel_v.shape
sobel = np.full((out_height, out_width, 3), intensity, dtype=np.float64) # b = intens... | 1,946 | 36.442308 | 96 | py |
nmap-generation | nmap-generation-main/generators/generator.py | from skimage.io import imread, imsave
import matplotlib.pyplot as plt
import numpy as np
import os
from utils import show_images
GODOT_EXECUTABLE = 'Godot_v3.5.1-stable_win64.exe'
REPOSITORY_PATH = 'D:/github/nmap-generation'
class Generator:
def __init__(self,
folder='D:/git/nmap-generation/assets',... | 2,345 | 30.702703 | 194 | py |
poincare_glove | poincare_glove-master/setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Run with:
sudo python ./setup.py install
"""
import os
import sys
import warnings
import ez_setup
from setuptools import setup, fi... | 12,941 | 38.218182 | 455 | py |
poincare_glove | poincare_glove-master/ez_setup.py | #!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... | 12,221 | 29.103448 | 87 | py |
poincare_glove | poincare_glove-master/gensim/nosy.py | #!/usr/bin/env python
"""
A simple testrunner for nose (or anything else).
Watch for changes in all file types specified in 'EXTENSIONS'.
If changes, run test executable in 'EXECUTABLE', with default
arguments 'DEFAULTARGS'.
The --with-color option needs the "rudolf" nose plugin. See:
http://pypi.python.org/pypi/rud... | 1,407 | 24.6 | 89 | py |
poincare_glove | poincare_glove-master/gensim/downloader.py | """
This module is an API for downloading, getting information and loading datasets/models.
Give information about available models/datasets:
>>> import gensim.downloader as api
>>>
>>> api.info() # return dict with info about available models/datasets
>>> api.info("text8") # return dict with info about "text8" dat... | 14,123 | 30.45657 | 112 | py |
poincare_glove | poincare_glove-master/gensim/utils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains various general utility functions."""
from __future__ import with_statement
from contextlib import contextmanag... | 59,164 | 29.217058 | 120 | py |
poincare_glove | poincare_glove-master/gensim/interfaces.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains implementations of basic interfaces used across the whole gensim package.
These interfaces usable for building c... | 15,338 | 34.755245 | 119 | py |
poincare_glove | poincare_glove-master/gensim/matutils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains math helper functions."""
from __future__ import with_statement
from itertools import chain
import logging
im... | 50,908 | 31.82334 | 119 | py |
poincare_glove | poincare_glove-master/gensim/__init__.py | """This package contains interfaces and functionality to compute pair-wise document similarities within a corpus
of documents.
"""
from gensim import parsing, corpora, matutils, interfaces, models, similarities, summarization, utils # noqa:F401
import logging
__version__ = '3.4.0'
class NullHandler(logging.Handler... | 593 | 27.285714 | 114 | py |
poincare_glove | poincare_glove-master/gensim/examples/dmlcz/gensim_genmodel.py | #!/usr/bin/env python
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s LANGUAGE METHOD
Generate topic models for the specified subcorpus. METHOD is currently one \
of 'tfidf', 'lsi', 'lda', 'rp'.
Example... | 2,925 | 36.037975 | 91 | py |
poincare_glove | poincare_glove-master/gensim/examples/dmlcz/gensim_xml.py | #!/usr/bin/env python
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s LANGUAGE METHOD
Generate similar.xml files, using a previously built model for METHOD.
Example: ./gensim_xml.py eng lsi
"""
import... | 4,688 | 37.434426 | 115 | py |
poincare_glove | poincare_glove-master/gensim/examples/dmlcz/gensim_build.py | #!/usr/bin/env python
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s LANGUAGE
Process the repository, accepting articles in LANGUAGE (or 'any').
Store the word co-occurence matrix and id mappings, w... | 2,276 | 28.960526 | 108 | py |
poincare_glove | poincare_glove-master/gensim/examples/dmlcz/dmlcorpus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Corpus for the DML-CZ project.
"""
import logging
import os.path
from gensim import interfaces, matutils
import dictionary # fo... | 8,424 | 37.47032 | 118 | py |
poincare_glove | poincare_glove-master/gensim/examples/dmlcz/__init__.py | 0 | 0 | 0 | py | |
poincare_glove | poincare_glove-master/gensim/examples/dmlcz/sources.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module contains implementations (= different classes) which encapsulate the
idea of a Digital Library document source.
A docum... | 12,851 | 35.101124 | 114 | py |
poincare_glove | poincare_glove-master/gensim/summarization/summarizer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module provides functions for summarizing texts. Summarizing is based on
ranks of text sentences using a variation of the TextRank algorithm [1]_.
.. [1] Federico Barrios, Federico L´opez... | 14,067 | 30.684685 | 120 | py |
poincare_glove | poincare_glove-master/gensim/summarization/bm25.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains function of computing rank scores for documents in
corpus and helper class `BM25` used in calculations. Original algorithm
descibed in [1]_, also you may check Wikipedia pa... | 5,481 | 28.005291 | 118 | py |
poincare_glove | poincare_glove-master/gensim/summarization/mz_entropy.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
from gensim.summarization.textcleaner import tokenize_by_word as _tokenize_by_word
from gensim.utils import to_unicode
import numpy
import scipy
def mz_keywords(text, blocksize=1024, scores=Fal... | 4,193 | 33.95 | 116 | py |
poincare_glove | poincare_glove-master/gensim/summarization/syntactic_unit.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains implementation of SyntacticUnit class. It generally used while text cleaning.
:class:`~gensim.summarization.syntactic_unit.SyntacticUnit` represents printable version of pr... | 1,310 | 23.277778 | 106 | py |
poincare_glove | poincare_glove-master/gensim/summarization/keywords.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains functions to find keywords of the text and building graph on tokens from text.
Examples
--------
Extract keywords from text
>>> from gensim.summarization import keywords
... | 15,888 | 27.526032 | 111 | py |
poincare_glove | poincare_glove-master/gensim/summarization/commons.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module provides functions of creating graph from sequence of values and removing of unreachable nodes.
Examples
--------
Create simple graph and add edges. Let's take a look at nodes.
... | 1,487 | 21.892308 | 110 | py |
poincare_glove | poincare_glove-master/gensim/summarization/graph.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains abstract class IGraph represents graphs interface and
class Graph (based on IGraph) which implements undirected graph.
Examples
--------
Create simple graph with 4 nodes.... | 12,075 | 22.632094 | 109 | py |
poincare_glove | poincare_glove-master/gensim/summarization/__init__.py |
# bring model classes directly into package namespace, to save some typing
from .summarizer import summarize, summarize_corpus # noqa:F401
from .keywords import keywords # noqa:F401
from .mz_entropy import mz_keywords # noqa:F401
| 234 | 38.166667 | 74 | py |
poincare_glove | poincare_glove-master/gensim/summarization/textcleaner.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains functions and processors used for processing text,
extracting sentences from text, working with acronyms and abbreviations.
Data
----
.. data:: SEPARATOR - Special separa... | 8,966 | 27.740385 | 119 | py |
poincare_glove | poincare_glove-master/gensim/summarization/pagerank_weighted.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module calculate PageRank [1]_ based on wordgraph.
.. [1] https://en.wikipedia.org/wiki/PageRank
Examples
--------
Calculate Pagerank for words
>>> from gensim.summarization.keywords ... | 4,714 | 25.789773 | 118 | py |
poincare_glove | poincare_glove-master/gensim/corpora/svmlightcorpus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Corpus in SVMlight format."""
from __future__ import with_statement
import logging
from gensim import utils
from gensim.corpora ... | 5,903 | 30.572193 | 118 | py |
poincare_glove | poincare_glove-master/gensim/corpora/bleicorpus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Сorpus in Blei's LDA-C format."""
from __future__ import with_statement
from os import path
import logging
from gensim import uti... | 5,755 | 30.113514 | 114 | py |
poincare_glove | poincare_glove-master/gensim/corpora/dictionary.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module implements the concept of Dictionary -- a mapping between words and their integer ids."""
from __future__ import with_s... | 25,070 | 35.6 | 120 | py |
poincare_glove | poincare_glove-master/gensim/corpora/sharded_corpus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Original author: Jan Hajic jr.
# Copyright (C) 2015 Radim Rehurek and gensim team.
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module implements a corpus class that stores its data in separate files called
"shards". This is a com... | 33,195 | 39.831488 | 119 | py |
poincare_glove | poincare_glove-master/gensim/corpora/csvcorpus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Zygmunt Zając <zygmunt@fastml.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Corpus in CSV format."""
from __future__ import with_statement
import logging
import csv
import itertools
from gensim import interfac... | 1,973 | 26.041096 | 97 | py |
poincare_glove | poincare_glove-master/gensim/corpora/mmcorpus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Corpus in the Matrix Market format."""
import logging
from gensim import matutils
from gensim.corpora import IndexedCorpus
logge... | 3,801 | 29.910569 | 113 | py |
poincare_glove | poincare_glove-master/gensim/corpora/malletcorpus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Corpus in `Mallet format <http://mallet.cs.umass.edu/import.php>`_."""
from __future__ import with_statement
import logging
from gensim import utils
from gensim.corpora import LowCorpus
lo... | 7,510 | 31.656522 | 114 | py |
poincare_glove | poincare_glove-master/gensim/corpora/textcorpus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Module provides some code scaffolding to simplify use of built dictionary for constructing BoW vectors.
Notes
-----
Text corpora usually reside on disk, as text files in one format or another ... | 25,229 | 35.671512 | 120 | py |
poincare_glove | poincare_glove-master/gensim/corpora/indexedcorpus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Base Indexed Corpus class."""
import logging
import six
import numpy
from gensim import interfaces, utils
logger = logging.getLo... | 6,298 | 33.233696 | 117 | py |
poincare_glove | poincare_glove-master/gensim/corpora/lowcorpus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Corpus in `GibbsLda++ format <http://gibbslda.sourceforge.net/>`_."""
from __future__ import with_statement
import logging
from g... | 9,852 | 33.093426 | 112 | py |
poincare_glove | poincare_glove-master/gensim/corpora/__init__.py | """
This package contains implementations of various streaming corpus I/O format.
"""
# bring corpus classes directly into package namespace, to save some typing
from .indexedcorpus import IndexedCorpus # noqa:F401 must appear before the other classes
from .mmcorpus import MmCorpus # noqa:F401
from .bleicorpus impo... | 768 | 41.722222 | 90 | py |
poincare_glove | poincare_glove-master/gensim/corpora/ucicorpus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Jonathan Esterhazy <jonathan.esterhazy at gmail.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Corpus in `UCI format <http://archive.ics.uci.edu/ml/datasets/Bag+of+Words>`_."""
from __future__ import with_stateme... | 9,478 | 31.799308 | 114 | py |
poincare_glove | poincare_glove-master/gensim/corpora/hashdictionary.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Homer Strong, Radim Rehurek
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module implements the "hashing trick" [1]_ -- a mapping between words and their integer ids
using a fixed and static mapping.
Notes
-----... | 13,148 | 36.676218 | 120 | py |
poincare_glove | poincare_glove-master/gensim/corpora/wikicorpus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Copyright (C) 2012 Lars Buitinck <larsmans@gmail.com>
# Copyright (C) 2018 Emmanouil Stergiadis <em.stergiadis@gmail.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Construc... | 21,369 | 33.635332 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/lda_worker.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Worker ("slave") process used in computing distributed LDA. Run this script \
on every node in your cluster. If you wish, you may ev... | 4,912 | 31.753333 | 106 | py |
poincare_glove | poincare_glove-master/gensim/models/ldamodel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
**For a faster implementation of LDA (parallelized for multicore machines), see** :mod:`gensim.models.ldamulticore`.
Latent Dirich... | 55,980 | 43.079528 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/normmodel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
import logging
from gensim import interfaces, matutils
logger = logging.getLogger(__name__)
class NormModel(interfaces.Transformatio... | 2,676 | 25.77 | 114 | py |
poincare_glove | poincare_glove-master/gensim/models/callbacks.py | import gensim
import logging
import copy
import sys
import numpy as np
if sys.version_info[0] >= 3:
from queue import Queue
else:
from Queue import Queue
# Visdom is used for training stats visualization
try:
from visdom import Visdom
VISDOM_INSTALLED = True
except ImportError:
VISDOM_INSTALLED = ... | 20,848 | 38.18985 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/lsimodel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Module for `Latent Semantic Analysis (aka Latent Semantic Indexing)
<https://en.wikipedia.org/wiki/Latent_semantic_analysis#Latent_s... | 43,382 | 41.826259 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/rpmodel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Random Projections (also known as Random Indexing).
For theoretical background on Random Projections, see [1]_.
Examples
--------... | 5,706 | 35.120253 | 119 | py |
poincare_glove | poincare_glove-master/gensim/models/word2vec.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Shiva Manne <manneshiva@gmail.com>
# Copyright (C) 2018 RaRe Technologies s.r.o.
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Produce word vectors with deep learning via word2vec's "skip-gram and CBOW models", using either
hiera... | 90,707 | 46.993651 | 155 | py |
poincare_glove | poincare_glove-master/gensim/models/lsi_dispatcher.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
""":class:`~gensim.models.lsi_dispatcher.Dispatcher` process which orchestrates
distributed :class:`~gensim.models.lsimodel.LsiModel` co... | 9,992 | 32.874576 | 119 | py |
poincare_glove | poincare_glove-master/gensim/models/poincare.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Jayant Jain <jayantjain1992@gmail.com>
# Copyright (C) 2017 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Python implementation of Poincaré Embeddings [1]_, an embedding that is better at capt... | 66,285 | 37.718458 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/logentropy_model.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module allows simple Bag of Words (BoW) represented corpus to be transformed into log entropy space.
It implements Log Entropy Model that produces entropy-weighted logarithmic term frequen... | 5,158 | 33.858108 | 118 | py |
poincare_glove | poincare_glove-master/gensim/models/atmodel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Radim Rehurek <radimrehurek@seznam.cz>
# Copyright (C) 2016 Olavur Mortensen <olavurmortensen@gmail.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Author-topic model in Python.
This module trains the author-topi... | 43,800 | 44.34265 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/basemodel.py | class BaseTopicModel(object):
def print_topic(self, topicno, topn=10):
"""Get a single topic as a formatted string.
Parameters
----------
topicno : int
Topic id.
topn : int
Number of words from topic that will be used.
Returns
-------... | 1,563 | 29.076923 | 114 | py |
poincare_glove | poincare_glove-master/gensim/models/hdpmodel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Jonathan Esterhazy <jonathan.esterhazy at gmail.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
#
# HDP inference code is adapted from the onlinehdp.py script by
# Chong Wang (chongw at cs.princeton.edu).
# http://www.c... | 25,094 | 36.067947 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/fasttext.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Authors: Shiva Manne <manneshiva@gmail.com>, Chinmaya Pancholi <chinmayapancholi13@gmail.com>
# Copyright (C) 2018 RaRe Technologies s.r.o.
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Learn word representations via fasttext's "skip-gra... | 43,325 | 47.193548 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/ldamulticore.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Jan Zikes, Radim Rehurek
# Copyright (C) 2014 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Latent Dirichlet Allocation (LDA) in Python, using all CPU cores to parallelize and
speed up model t... | 13,164 | 43.627119 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/utils_any2vec.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Shiva Manne <s.manne@rare-technologies.com>
# Copyright (C) 2018 RaRe Technologies s.r.o.
"""General functions used for any2vec models."""
import logging
import numpy as np
from gensim import utils
from numpy import zeros, dtype, float32 as REAL, ascontiguous... | 10,055 | 41.610169 | 118 | py |
poincare_glove | poincare_glove-master/gensim/models/lsi_worker.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
""":class:`~gensim.models.lsi_worker.Worker` ("slave") process used in computing
distributed :class:`~gensim.models.lsimodel.LsiModel`.
... | 6,037 | 30.284974 | 115 | py |
poincare_glove | poincare_glove-master/gensim/models/coherencemodel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Module for calculating topic coherence in python. This is the implementation of
the four stage topic coherence pipeline from the pap... | 20,901 | 40.804 | 117 | py |
poincare_glove | poincare_glove-master/gensim/models/__init__.py | """
This package contains algorithms for extracting document representations from their raw
bag-of-word counts.
"""
# bring model classes directly into package namespace, to save some typing
from .coherencemodel import CoherenceModel # noqa:F401
from .hdpmodel import HdpModel # noqa:F401
from .ldamodel import LdaMod... | 2,369 | 36.619048 | 102 | py |
poincare_glove | poincare_glove-master/gensim/models/lda_dispatcher.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s SIZE_OF_JOBS_QUEUE
Dispatcher process which orchestrates distributed LDA computations. Run this \
script onl... | 8,170 | 35.641256 | 112 | py |
poincare_glove | poincare_glove-master/gensim/models/base_any2vec.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Shiva Manne <manneshiva@gmail.com>
# Copyright (C) 2018 RaRe Technologies s.r.o.
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Contains base classes required for implementing any2vec algorithms."""
from gensim import utils
from g... | 39,076 | 46.024067 | 219 | py |
poincare_glove | poincare_glove-master/gensim/models/translation_matrix.py | #!/usr/bin/env python
# encoding: utf-8
"""Produce translation matrix to translate the word from one language to another language, using either
standard nearest neighbour method or globally corrected neighbour retrieval method [1]_.
This method can be used to augment the existing phrase tables with more candidate tra... | 17,572 | 39.121005 | 118 | py |
poincare_glove | poincare_glove-master/gensim/models/doc2vec.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Shiva Manne <manneshiva@gmail.com>
# Copyright (C) 2018 RaRe Technologies s.r.o.
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Deep learning via the distributed memory and distributed bag of words models from
[1]_, using either... | 47,333 | 47.497951 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/ldaseqmodel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
# Based on Copyright (C) 2016 Radim Rehurek <radimrehurek@seznam.cz>
"""
Inspired by the Blei's original DTM code and paper.
Original DTM C/C++ code: https://github.com/blei-lab/dtm
DTM Paper: h... | 43,899 | 37.207137 | 123 | py |
poincare_glove | poincare_glove-master/gensim/models/phrases.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automatically detect common phrases (multiword expressions) from a stream of sentences.
The phrases are collocations (frequently co-occurring tokens). See [1]_ for the
exact formula.
For examp... | 27,332 | 40.921779 | 119 | py |
poincare_glove | poincare_glove-master/gensim/models/keyedvectors.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Shiva Manne <manneshiva@gmail.com>
# Copyright (C) 2018 RaRe Technologies s.r.o.
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Word vector storage and similarity look-ups.
Common code independent of the way the vectors are train... | 117,148 | 41.185452 | 150 | py |
poincare_glove | poincare_glove-master/gensim/models/tfidfmodel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Radim Rehurek <radimrehurek@seznam.cz>
# Copyright (C) 2017 Mohit Rathore <mrmohitrathoremr@gmail.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
import logging
from functools import partial
from gensim import interf... | 13,748 | 33.807595 | 119 | py |
poincare_glove | poincare_glove-master/gensim/models/deprecated/word2vec.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Warnings
--------
.. deprecated:: 3.3.0
Use :mod:`gensim.models.word2vec` instead.
Produce word vectors with deep learning via wo... | 87,512 | 44.938583 | 119 | py |
poincare_glove | poincare_glove-master/gensim/models/deprecated/old_saveload.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Warnings
--------
.. deprecated:: 3.3.0
Use :mod:`gensim.utils` instead.
Class containing the old SaveLoad class with modeified `un... | 15,023 | 36.56 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/deprecated/fasttext.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Authors: Chinmaya Pancholi <chinmayapancholi13@gmail.com>, Shiva Manne <s.manne@rare-technologies.com>
# Copyright (C) 2017 RaRe Technologies s.r.o.
"""
Warnings
--------
.. deprecated:: 3.3.0
Use :mod:`gensim.models.fasttext` instead.
Learn word representations via... | 32,204 | 44.876068 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/deprecated/__init__.py | """This package contains some deprecated implementations of algorithm, will be removed soon."""
| 96 | 47.5 | 95 | py |
poincare_glove | poincare_glove-master/gensim/models/deprecated/fasttext_wrapper.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Jayant Jain <jayantjain1992@gmail.com>
# Copyright (C) 2017 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Warnings
--------
.. deprecated:: 3.2.0
Use :mod:`gensim.models.fasttext` instead.... | 17,995 | 38.378556 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/deprecated/doc2vec.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Warnings
--------
.. deprecated:: 3.3.0
Use :mod:`gensim.models.doc2vec` instead.
Deep learning via the distributed memory and d... | 45,785 | 43.756598 | 118 | py |
poincare_glove | poincare_glove-master/gensim/models/deprecated/keyedvectors.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Warnings
--------
.. deprecated:: 3.3.0
Use :mod:`gensim.models.keyedvectors` instead.
Word vector storage and similarity look-ups... | 43,913 | 39.850233 | 119 | py |
poincare_glove | poincare_glove-master/gensim/models/wrappers/ldavowpalwabbit.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Dave Challis <dave@suicas.net>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Python wrapper for `Vowpal Wabbit's Latent Dirichlet Allocation <https://github.com/JohnLangford/vowpal_wabbit/>`_.
This uses `Matt Hoffman'... | 28,176 | 30.482682 | 119 | py |
poincare_glove | poincare_glove-master/gensim/models/wrappers/wordrank.py | # Copyright (C) 2017 Parul Sethi <parul1sethi@gmail.com>
# Copyright (C) 2017 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Python wrapper around `Wordrank <https://bitbucket.org/shihaoji/wordrank/>`_.
Original paper: `"WordRank: Learning Word Embeddi... | 13,370 | 39.518182 | 117 | py |
poincare_glove | poincare_glove-master/gensim/models/wrappers/ldamallet.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Python wrapper for `Latent Dirichlet Allocation (LDA) <https://en.wikipedia.org/wiki/Latent_Dirichlet_allocation>`_
from `MALLET, th... | 22,613 | 37.134907 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/wrappers/varembed.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Anmol Gulati <anmol01gulati@gmail.com>
# Copyright (C) 2017 Radim Rehurek <radimrehurek@seznam.cz>
"""Python wrapper around `Varembed model <https://github.com/rguthrie3/MorphologicalPriorsForWordEmbeddings>`_.
Original paper:`"Morphological Priors fo... | 4,782 | 35.792308 | 120 | py |
poincare_glove | poincare_glove-master/gensim/models/wrappers/fasttext.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Jayant Jain <jayantjain1992@gmail.com>
# Copyright (C) 2017 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Warnings
--------
.. deprecated:: 3.2.0
Use :mod:`gensim.models.fasttext` instead.... | 1,296 | 32.25641 | 99 | py |
poincare_glove | poincare_glove-master/gensim/models/wrappers/__init__.py | """
This package contains wrappers for other topic modeling programs.
"""
from .ldamallet import LdaMallet # noqa:F401
from .dtmmodel import DtmModel # noqa:F401
from .ldavowpalwabbit import LdaVowpalWabbit # noqa:F401
from .fasttext import FastText # noqa:F401
from .wordrank import Wordrank # noqa:F401
from .var... | 355 | 31.363636 | 65 | py |
poincare_glove | poincare_glove-master/gensim/models/wrappers/dtmmodel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Artyom Topchyan <artyom.topchyan@live.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
# Based on Copyright (C) 2014 Radim Rehurek <radimrehurek@seznam.cz>
"""Python wrapper for `Dynamic Topic Models (DTM) <http://www.... | 21,044 | 33.5 | 120 | py |
poincare_glove | poincare_glove-master/gensim/parsing/preprocessing.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains methods for parsing and preprocessing strings. Let's consider the most noticeable:
* :func:`~gensim.parsing.preprocessing.remove_stopwords` - remove all stopwords from str... | 12,675 | 31.839378 | 119 | py |
poincare_glove | poincare_glove-master/gensim/parsing/porter.py | #!/usr/bin/env python
"""Porter Stemming Algorithm
This is the Porter stemming algorithm, ported to Python from the
version coded up in ANSI C by the author. It may be be regarded
as canonical, in that it follows the algorithm presented in [1]_, see also [2]_
Author - Vivake Gupta (v@nano.com), optimizations and clea... | 15,333 | 25.483592 | 120 | py |
poincare_glove | poincare_glove-master/gensim/parsing/__init__.py | """This package contains functions to preprocess raw text"""
from .porter import PorterStemmer # noqa:F401
from .preprocessing import (remove_stopwords, strip_punctuation, strip_punctuation2, # noqa:F401
strip_tags, strip_short, strip_numeric,
strip_non_alphanu... | 498 | 54.444444 | 97 | py |
poincare_glove | poincare_glove-master/gensim/viz/poincare.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Jayant Jain <jayantjain1992@gmail.com>
# Copyright (C) 2017 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Utilities for creating 2-D visualizations of Poincare models and Poincare distance he... | 6,152 | 31.903743 | 120 | py |
poincare_glove | poincare_glove-master/gensim/viz/__init__.py | """
This package contains functions to visualize different models from `gensim.models`.
"""
| 92 | 22.25 | 83 | py |
poincare_glove | poincare_glove-master/gensim/topic_coherence/direct_confirmation_measure.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains functions to compute direct confirmation on a pair of words or word subsets."""
import logging
import numpy as... | 7,953 | 38.376238 | 118 | py |
poincare_glove | poincare_glove-master/gensim/topic_coherence/aggregation.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains functions to perform aggregation on a list of values obtained from the confirmation measure."""
import logging
... | 1,014 | 25.710526 | 119 | py |
poincare_glove | poincare_glove-master/gensim/topic_coherence/text_analysis.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains classes for analyzing the texts of a corpus to accumulate
statistical information about word occurrences."""
im... | 24,297 | 35.871017 | 114 | py |
poincare_glove | poincare_glove-master/gensim/topic_coherence/indirect_confirmation_measure.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
r"""This module contains functions to compute confirmation on a pair of words or word subsets.
Notes
-----
The advantage of indirect co... | 12,469 | 35.893491 | 119 | py |
poincare_glove | poincare_glove-master/gensim/topic_coherence/segmentation.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains functions to perform segmentation on a list of topics."""
import logging
logger = logging.getLogger(__name__)
... | 3,532 | 26.601563 | 104 | py |
poincare_glove | poincare_glove-master/gensim/topic_coherence/probability_estimation.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module contains functions to perform segmentation on a list of topics."""
import itertools
import logging
from gensim.topic_co... | 9,041 | 37.476596 | 120 | py |
poincare_glove | poincare_glove-master/gensim/topic_coherence/__init__.py | """
This package contains implementation of the individual components of
the topic coherence pipeline.
"""
| 107 | 20.6 | 68 | py |
poincare_glove | poincare_glove-master/gensim/test/test_sharded_corpus.py | """
Testing the test sharded corpus.
"""
import os
import unittest
import random
import numpy as np
import shutil
from scipy import sparse
from gensim.utils import is_corpus
from gensim.corpora.sharded_corpus import ShardedCorpus
from gensim.utils import mock_data, xrange
##########################################... | 9,286 | 32.286738 | 108 | py |
poincare_glove | poincare_glove-master/gensim/test/test_normmodel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
import numpy as n... | 5,765 | 35.961538 | 104 | py |
poincare_glove | poincare_glove-master/gensim/test/test_aggregation.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
from gensim.topic_... | 774 | 24 | 76 | py |
poincare_glove | poincare_glove-master/gensim/test/test_similarity_metrics.py | #!/usr/bin/env python
# encoding: utf-8
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated test to check similarity functions and isbow function.
"""
import logging
import unittest
from gensim import matutils
from scipy.sparse import csr_matrix, csc_matrix
import numpy as np... | 9,813 | 34.557971 | 100 | py |
poincare_glove | poincare_glove-master/gensim/test/test_poincare.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Jayant Jain <jayantjain1992@gmail.com>
# Copyright (C) 2017 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking the poincare module from the models package.
"""
import ... | 16,790 | 44.877049 | 119 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.