![]() |
Sistema de Consulta Abierta
Sistema de consulta abierta con módulo de análisis semántico
|
Métodos públicos | |
| def | __init__ |
| def | word_top |
| def | word_top |
| def | inv_top_sums |
| def | inv_top_sums |
| def | top_doc |
| def | top_doc |
| def | corpus |
| def | corpus |
| def | Z |
| def | Z |
| def | K |
| def | K |
| def | V |
| def | V |
| def | iteration |
| def | iteration |
| def | train |
Métodos públicos heredados desde vsm.model.ldacgsseq.LdaCgsSeq | |
| def | __init__ |
| def | Z_split |
| def | docs |
| def | train |
| def | save |
Métodos públicos estáticos | |
| def | load |
Métodos públicos estáticos heredados desde vsm.model.ldacgsseq.LdaCgsSeq | |
| def | load |
Atributos públicos | |
| V | |
| corpus | |
| Z | |
| word_top | |
| inv_top_sums | |
| top_doc | |
| iteration | |
Atributos públicos heredados desde vsm.model.ldacgsseq.LdaCgsSeq | |
| context_type | |
| K | |
| V | |
| indices | |
| corpus | |
| Z | |
| alpha | |
| word_top | |
| inv_top_sums | |
| top_doc | |
| iteration | |
| log_probs | |
| seed | |
Atributos públicos estáticos | |
| tuple | maxint = np.iinfo(np.int32) |
| list | seeds = [np.random.randint(0, maxint) for n in range(n_proc)] |
| K = beta) | |
| tuple | pbar = ProgressBar(widgets=[Percentage(), Bar()], maxval=n_iterations) |
| int | iteration = 0 |
| tuple | data = zip(docs, doc_indices, self._mtrand_states) |
| tuple | results = p.map(update, data) |
| tuple | lp = np.sum(logp_ls) |
An implementation of LDA using collapsed Gibbs sampling with multi-processing. On Windows platforms, LdaCgsMulti is not supported. A NotImplementedError will be raised notifying the user to use the LdaCgsSeq package. Users desiring a platform-independent fallback should use LDA(multiprocess=True) to initialize the object, which will return either a LdaCgsMulti or a LdaCgsSeq instance, depending on the platform, while raising a RuntimeWarning.
| def vsm.model.ldacgsmulti.LdaCgsMulti.__init__ | ( | self, | |
corpus = None, |
|||
context_type = None, |
|||
K = 20, |
|||
V = 0, |
|||
Z = [], |
|||
alpha = [], |
|||
beta = [], |
|||
n_proc = 2, |
|||
seeds = None |
|||
| ) |
Initialize LdaCgsMulti.
:param corpus: Source of observed data.
:type corpus: `Corpus`
:param context_type: Name of tokenization stored in `corpus` whose tokens
will be treated as documents.
:type context_type: string, optional
:param K: Number of topics. Default is `20`.
:type K: int, optional
:param alpha: Context priors. Default is a flat prior of 0.01
for all contexts.
:type alpha: list, optional
:param beta: Topic priors. Default is 0.01 for all topics.
:type beta: list, optional
:param n_proc: Number of processors used for training. Default is
2.
:type n_proc: int, optional
:param seeds: List of random seeds, one for each thread.
The length of the list should be same as `n_proc`. Default is `None`.
:type seeds: list of integers, optional
|
static |
A static method for loading a saved LdaCgsMulti model. :param filename: Name of a saved model to be loaded. :type filename: string :returns: m : LdaCgsMulti object :See Also: :class:`numpy.load`
| def vsm.model.ldacgsmulti.LdaCgsMulti.train | ( | self, | |
n_iterations = 500, |
|||
verbose = 1 |
|||
| ) |
Takes an optional argument, `n_iterations` and updates the model
`n_iterations` times.
:param n_iterations: Number of iterations. Default is 500.
:type n_iterations: int, optional
:param verbose: If `True`, current number of iterations
are printed out to notify the user. Default is `True`.
:type verbose: boolean, optional
|
static |
LdaCgsMulti is not implemented on Windows. Please use LdaCgsSeq.
1.8.8