Saravanan666/pypi-org huggingface dataset:
Package: sequence-classifier
sequence-classifiersequence-classifieris an open-source library designed for sequence classification in PyTorch. It provides utilities for sequence classifiers, particularly Conditional random fields (CRFs), and it can calculate the log likelihood of tag sequences and retrieve the best label sequences.sequence-classifieralso offers the capability to compute the marginal log likelihood and the marginal probability. These features are handy when working with partially annotated datasets.If you are searching for libraries to handle sequence labeling tasks such as named-entity recognition or part-of-speech tagging combined with the use of foundation models like BERT, RoBERTa, or DeBERTa, you will findsequence-classifierto be helpful.PrerequisitesPython 3.8+InstallationYou can install sequence-classifier via pip:pipinstallsequence-classifierBasic Usageimporttorchfromsequence_classifier.crfimportCrfbatch_size=3sequence_length=15num_tags=6logits=torch.randn(batch_size,sequence_length,num_tags)tag_indices=torch.randint(0,num_tags,(batch_size,sequence_length))model=Crf(num_tags)dist=model(logits)nll_loss=dist.log_likelihood(tag_indices).sum().neg()best_sequence=dist.argmaxReferencesAlexander Rush. 2020.Torch-Struct: Deep Structured Prediction Library. InProceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 335–342, Online. Association for Computational Linguistics.Yuta Tsuboi, Hisashi Kashima, Shinsuke Mori, Hiroki Oda, and Yuji Matsumoto. 2008.Training Conditional Random Fields Using Incomplete Annotations. InProceedings of the 22nd International Conference on Computational Linguistics (Coling 2008), pages 897–904, Manchester, UK. Coling 2008 Organizing Committee.
Package: sequence-edits
Sequence EditsTools for encoding/decoding sequence editions (insertions/deletions) in compact formaEditsclassSkip:idx:intclassInsert:idx:intvalue:TAll edits are applied w.r.t. the original list. So, order of edits only affects the order in which values are insterted to a same index.Usageimportsequence_editsasseedits=[se.Insert(idx=1,value='the'),se.Skip(idx=4)]xs=['And','earth','was','without','no','form']list(se.apply(edits,xs))#  ['And', 'the', 'earth', 'was', 'without',       'form']
Package: sequence-evaluate
SeqEval: A python package for evaluating Seq2Seq modelsSequence Evaluator (SeqEval) is a python package that computes metrics useful for evaluating Seq2Seq models for many tasks such as: machine translation, dialogue response generation, and text summarization. There already exists many packages to compute those metrics, but Seq2Eval puts them all in one place!Installationpipinstallsequence-evaluateUsageYou can easily compute all metrics in just a few lines of code.You first import the classSeqEvaland create an instance of it:fromseq_evalimportSeqEvalevaluator=SeqEval()The evaluator expects two python lists containingcandidates(outputs generated by the model) andreferences(ground-truth data).For example:candidates=["he began by starting a five person war cabinet and included chamberlain as lord president of the council","the siege lasted from 250 to 241 bc, the romans laid siege to lilybaeum","the original ocean water was found in aquaculture"]references=["he began his premiership by forming a five-man war cabinet which included chamberlain as lord president of the council","the siege of lilybaeum lasted from 250 to 241 bc, as the roman army laid siege to the carthaginian-held sicilian city of lilybaeum","the original mission was for research into the uses of deep ocean water in ocean thermal energy conversion (otec) renewable energy production and in aquaculture"]You can now compute all metrics by using theevaluatefunction: (Settingverbose=Trueprints out the results)scores=evaluator.evaluate(candidates,references,verbose=True)The function returns a dictionary containing all computed metric values:{'bleu_1': 0.4428272792647754,
 'bleu_2': 0.35920252706356015,
 'bleu_3': 0.29702864345243746,
 'bleu_4': 0.2527668976020239,
 'inter_dist1': 0.1294642799346348,
 'inter_dist2': 0.5837103808275891,
 'intra_dist1': 0.31033264382268116,
 'intra_dist2': 0.7908440001400115,
 'rouge_1_f1': 0.6512670259900423,
 'rouge_1_precision': 0.8539562289562289,
 'rouge_1_recall': 0.5528035775713794,
 'rouge_2_f1': 0.3928074411537155,
 'rouge_2_precision': 0.5244559362206421,
 'rouge_2_recall': 0.3353174603174603,
 'rouge_l_f1': 0.6282785202429159,
 'rouge_l_precision': 0.8122895622895623,
 'rouge_l_recall': 0.5369305616983636,
 'semantic_textual_similarity': 0.8229544957478842}DependenciesMake sure that you have the following libraries installed:transformers 4.16.2
sentence-transformers 2.2.0
ntlk 3.2.5
torch 1.10.0+cu111
rouge 1.0.1
numpy 1.21.5ContactTarek Naous:Scholar|Github|Linkedin|Research Gate|Personal Wesbite|tareknaous@gmail.com
Package: sequence-jacobian
Sequence-Space Jacobian (SSJ)SSJ is a toolkit for analyzing dynamic macroeconomic models with (or without) rich microeconomic heterogeneity.The conceptual framework is based on our paper Adrien Auclert, Bence Bardóczy, Matthew Rognlie, Ludwig Straub (2021),Using the Sequence-Space Jacobian to Solve and Estimate Heterogeneous-Agent Models, Econometrica 89(5), pp. 2375–2408[ungated copy].Requirements and installationSSJ runs on Python 3.7 or newer, and requires Python's core numerical libraries (NumPy, SciPy, Numba). We recommend that you first install the latestAnacondadistribution. This includes all of the packages and tools that you will need to run our code.To install SSJ, open a terminal and typepip install sequence-jacobianOptional package: There is an optional interface for plotting the directed acyclic graph (DAG) representation of models, which requiresGraphviz for Python. With Anaconda, you can install this by typingconda install -c conda-forge python-graphviz.Using SSJ: introductory notebooksTo learn how to use the toolkit, it's best to work through our introductory Jupyter notebooks, which show how SSJ can be used to represent and solve various models. We recommend working through the notebooks in the order listed below.Click here to download all notebooks as a zip.RBCrepresent macro models as collections of blocks (DAG)write SimpleBlocks and CombinedBlockscompute linearized and non-linear (perfect-foresight) impulse responsesKrusell-Smithwrite HetBlocks to represent heterogeneous agentsconstruct general-equilibrium Jacobians manuallycompute the log-likelihood of the model given time-series dataOne-asset HANKadapt an off-the-shelf HetBlock to any macro environment using helper functionssee a more advanced example of calibrationTwo-asset HANKwrite SolvedBlocks to represent implicit aggregate equilibrium conditionsre-use saved Jacobiansfine tune options of block methodsLabor searchexample with multiple exogenous statesshocks to transition matrix of exogenous statesResourcesIf you'd like to learn more about Python, its numerical libraries, and Jupyter notebooks, theintroductory lectures at QuantEconare a terrific place to start. More advanced tutorials for numerical Python include theSciPy Lecture Notesand thePython Data Science Handbook. There are many other good options as well: thanks to Python's popularity, nearly limitless answers are available via Google, Stack Overflow, and YouTube.If you have questions or issues specific to this package, consider posting them on ourGitHub issue tracker.For those who used our pre-1.0 toolkit, which had a number of differences relative post-1.0, you can go back to ourearly toolkit pageif needed.TeamThe current development team for SSJ isBence BardóczyMichael CaiMatthew Rognliewith contributions also from Adrien Auclert, Martin Souchier, and Ludwig Straub.
Package: sequence-label
sequence-labelsequence-labelis a Python library that streamlines the process of creating tensors for sequence labels and reconstructing sequence labels data from tensors. Whether you're working on named entity recognition, part-of-speech tagging, or any other sequence labeling task, this library offers a convenient utility to simplify your workflow.Basic UsageImport the necessary dependencies:fromtransformersimportAutoTokenizerfromsequence_labelimportLabelSet,SequenceLabelfromsequence_label.transformersimportcreate_alignmentsStart by creating sequence labels using theSequenceLabel.from_dictmethod. Define your text and associated labels:text1="Tokyo is the capital of Japan."label1=SequenceLabel.from_dict(tags=[{"start":0,"end":5,"label":"LOC"},{"start":24,"end":29,"label":"LOC"},],size=len(text1),)text2="The Monster Naoya Inoue is the who's who of boxing."label2=SequenceLabel.from_dict(tags=[{"start":12,"end":23,"label":"PER"}],size=len(text2),)texts=[text1,text2]labels=[label1,label2]Next, tokenize yourtextsand create thealignmentsusing thecreate_alignmentsmethod.alignmentsis a tuple of instances ofLabelAlignmentthat aligns sequence labels with the tokenized result:tokenizer=AutoTokenizer.from_pretrained("roberta-base")batch_encoding=tokenizer(texts)alignments=create_alignments(batch_encoding=batch_encoding,lengths=list(map(len,texts)),padding_token=tokenizer.pad_token)Now, create alabel_setthat will allow you to create tensors from sequence labels and reconstruct sequence labels from tensors. Use thelabel_set.encode_to_tag_indicesmethod to createtag_indices:label_set=LabelSet(labels={"ORG","LOC","PER","MISC"},padding_index=-1,)tag_indices=label_set.encode_to_tag_indices(labels=labels,alignments=alignments,)Finally, use thelabel_set.decodemethod to reconstruct the sequence labels fromtag_indicesandalignments:labels2=label_set.decode(tag_indices=tag_indices,alignments=alignments,)assertlabels==labels2Installationpip install sequence-label
Package: sequencelearn
➡️ sequence-learnWithsequence-learn, you can build models for named entity recognition as quickly as if you were building a sklearn classifier.It takes as input embedded token lists, which you can create within a few lines of code using theembedders library. The labels are on token-level, i.e., for each token, you must provide some information in a simple list.InstallationYou can set up this library via either running$ pip install sequencelearn, or via cloning this repository and running$ pip install -r requirements.txtin your repository.A sample installation includingembedderswould be (includingspaCyfor tokenization):$ conda create --name sequence-learn python=3.9
$ conda activate sequence-learn
$ pip install sequencelearn
$ pip install embedders
$ python -m spacy download en_core_web_smUsageOnce you have installed the package(s), you can easily create the input for a text corpus and put it - together with the required labels - into the model training.fromembedders.extraction.contextualimportTransformerTokenEmbedderfromsequencelearn.sequence_taggerimportCRFTaggercorpus=["I went to Cologne in 2009","My favorite number is 41",# ...]labels=[["OUTSIDE","OUTSIDE","OUTSIDE","CITY","OUTSIDE","YEAR"],["OUTSIDE","OUTSIDE","OUTSIDE","OUTSIDE","DIGIT"],# ...]# use embedders to easily convert your raw dataembedder=TransformerTokenEmbedder("distilbert-base-uncased","en_core_web_sm")embeddings=embedder.fit_transform(corpus)# contains a list of ragged shape [num_texts, num_tokens (text-specific), embedding_dimension]tagger=CRFTagger()tagger.fit(embeddings,labels)Now that you've trained a tagger model, you can easily apply it to new text data.sentence=["My birthyear is 2002"]print(tagger.predict(embedder.transform(sentence)))# prints [['OUTSIDE', 'OUTSIDE', 'OUTSIDE', 'YEAR']]RoadmapAdd documentation to existing modelsAdd sequence-based models (e.g. CRF-based)Add sample projectsEnable models to be converted to bytes / stored to diskAdd test casesIf you want to have something added, feel free to open anissue.ContributingContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make aregreatly appreciated.If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!Fork the ProjectCreate your Feature Branch (git checkout -b feature/AmazingFeature)Commit your Changes (git commit -m 'Add some AmazingFeature')Push to the Branch (git push origin feature/AmazingFeature)Open a Pull RequestAnd please don't forget to leave a ⭐ if you like the work!LicenseDistributed under the Apache 2.0 License. See LICENSE.txt for more information.ContactThis library is developed and maintained bykern.ai. If you want to provide us with feedback or have some questions, don't hesitate to contact us. We're super happy to help ✌️AcknowledgementsHuge thanks toErik Zieglerfor helping with the CRF implementation!
Package: sequencelib
sequencelibUsing classes and methods in sequencelib.py it is possible to read and write textfiles containing DNA or protein-sequences (possibly aligned) and to analyze and manipulate the sequence in various ways.AvailabilityThe sequencelib.py module is available on GitHub:https://github.com/agormp/sequenceliband on PyPI:https://pypi.org/project/sequencelib/Installationpython3 -m pip install sequencelibUpgrading to latest version:python3 -m pip install --upgrade sequencelibHighlightsTo be written
Package: sequence-mining
Sequence-miningDescriptionThis package implements SPAM algorithm described in the paperSequential PAttern Mining using A Bitmap Representationby
Jay Ayres, Johannes Gehrke, Tomi Yiu, and Jason Flannick.This package mostly translates a SPAM implementation written in Java byPhilippe Fournier-Viger, which can be found
in the next repositoryspmf. For more information aboutspmfimplementation,
please, read the Web pageMining Frequent Sequential Patterns Using The CM-SPAM AlgorithmInstallationpip3installsequence-miningUsagefromsequence_mining.spamimportSpamAlgo# Input: List[List[List[int]]] or Sequences [ Sequence [Transaction[ids] ]]# ids in a transaction are expected to be lexicographically sortedsequences=[[[0,2,10,13,14,15,18,20],[2,7,12,15,17,19],[6,12,19],[0,3,4,6,15],[1,3,10,13,15],[8,10],[4,8,9,10]],[[9,10,17],[4],[0,1,2,3,4,5,12,13,19],[0,1,5,10,17,18],[4,7,12],[2,8,9,13,15,16,19],[3,5,6,9,11,13,18,19],[2,5,9,10,13,16,20],[2,3,6]],[[0,9,10,13,14,19,20],[0,1,9,15,17],[1,7,11,12,15,20],[7,9,10,11,14,18],[0,10],[5,13,15],[1,5,9,15],[1,5,7,8,19],[2,6,11,14,16],[3,10,11,12]],[[15],[6,9,10,12,13,15,16],[13,16]]]algo=SpamAlgo(0.7)algo.spam(sequences)# print mined sequencesprint(algo.frequent_items)
Package: sequence-model
logoSequence-stratigraphic modeling with PythonAboutSequenceis a modular 2D (i.e., profile) sequence stratigraphic model
that is written in Python and implemented within the Landlab framework.
Sequence represents time-averaged fluvial and marine sediment transport
via differential equations. The modular code includes components to deal
with sea level changes, sediment compaction, local or flexural isostasy,
and tectonic subsidence and uplift.For more information see:https://sequence.readthedocs.io/en/develop/
Package: sequence-modelling
sequence-modellingNumerically optimized time-series and sequence modelling in Python.Key featuresHidden Markov Models and Quasi-Deterministic Hidden Markov ModelsNumerically stable: floating point arithmetic performed in log space to avoid underflowEasy to use (based on the scikit-learn API)Pure Python and Numpy basedOpen source and commercially usable (BSD license)Support for discrete and continuous (Gaussian) emissionsInstallationThe easiest way to install sequence-modelling is using pip:pipinstallsequence-modellingExample usageimportnumpyasnpfromsequence_modelling.emmissionsimportGaussianfromsequence_modelling.hmmimportStandardHMMimportsequence_modelling.hmmvizasplt# define a 2-state HMM estimator with one-dimensional Gaussian emissions# the transition matrixA=np.array([[0.6,0.4],[0.3,0.7],[0.5,0.5]])# the emission objectO=Gaussian(mu=np.array([[-100.0,100.0]]),covar=np.array([[[10.0]],[[10.0]]]))# build the HMM model objecthmm=StandardHMM(A,O)# sample 100 observations from the generative modelobs,path=hmm.sample(dim=1,N=100)# fit the model to the datalikelihood,ll,duration,rankn,res=hmm.fit([obs])# decode (predict) the most likely state sequence using the Viterbi algorithmdecoded_path=hmm.viterbi(obs)# visualize the decoded state sequencefrommatplotlib.pyplotimportfigure,showfa=figure()plt.view_viterbi(fa.add_subplot(1,1,1),[obs],[decoded_path],hmm.O.mu,seq=0)fa.tight_layout()show()
Package: sequence-model-train
sequence-model-trainSequence-model-train is a Python library for implementing Long Short-Term Memory (LSTM) models on time-series data. It takes a CSV file as input and allows you to specify various hyperparameters for the model.Github:​https://github.com/ZhangLe59151/price_forecastPyPi:​https://pypi.org/project/sequence-model-train/Document:​https://zhanglenus.gitbook.io/sequence-model-train-library-document/Example on the notebook:https://zhanglenus.gitbook.io/sequence-model-train-library-document/notebook-demoInstallationTo install Library Sequence-model-train, run the following command in your terminal:pip install sequence-model-trainUsageTo use Library Sequence-model-train, follow these steps:Import the library:from sequence_model_train import train_modelCreate an instance of the TrainModel class and pass in the path to your training data CSV file:train = train_model.TrainModel('/path/to/data.csv')Update the hyperparameters for the model by calling theupdate_params()method:train.update_params(n_in=30, n_out=7, batch_size=128, hidden_size=128, num_epochs=100)Train the model by calling the train() method:train.train()API ReferenceTrainModelParameters:data_path: a string that specifies the path to the training data CSV file. When creating an instance of the TrainModel class, you can provide the 'data_path' parameter to load your data. It is important to note that the last column in the CSV file should be the labels.Methods:update_params: After creating an instance of the TrainModel class, you can update the following hyperparameters:data_path: The data path to your training dataset in CSV format.n_in: The number of time steps to use as input. The default value is 3.n_out: The number of future time steps to predict. The default value is 5.batch_size: The batch size to use during training. The default value is 32.hidden_size: The number of units in the LSTM layer. The default value is 32.num_layers: The number of the LSTM layer. The default value is 3.num_epochs: The number of epochs to train the model for. The default value is 10.train: Train the model. Training the model involves several steps, including data processing, normalization, and splitting into training and validation sets. Once trained, the model's performance is evaluated on the validation set using metrics such as loss, mean absolute error (MAE), and mean absolute percentage error (MAPE).Example# train the model
from sequence_model_train import train_model

train = train_model.TrainModel('./train.csv')
train.update_params(n_in=30, n_out=7, batch_size=128, hidden_size=128, num_epochs=100)
train.train()# the result

{
 'model': 'lstm',
 'valid_result': 
   {
    'valid_loss': 61.97545757072,
    'valid_mae': 21.2288062782732,
    'valid_mape': 0.1061233304225267
   }
}ConclusionSequence-model-train is a powerful tool for training LSTM models on time-series data. Its easy-to-use interface and comprehensive API make it a great choice for both beginners and advanced users. Hope you find this library useful and welcome your feedback and suggestions for improvement.
Package: sequence-qc
# sequence_qcPackage for doing various ad-hoc quality control steps from MSK-ACCESS generated FASTQ or BAM files[![Build Status](https://travis-ci.com/msk-access/sequence_qc.svg?branch=master)](https://travis-ci.com/msk-access/sequence_qc) [![PyPi](https://img.shields.io/pypi/v/sequence_qc.svg?)](https://pypi.python.org/pypi/sequence_qc) [![Anaconda](https://anaconda.org/ionox0/sequence-qc/badges/version.svg)](https://anaconda.org/ionox0/sequence-qc/)Free software: Apache Software License 2.0Documentation: [https://msk-access.gitbook.io/sequence-qc/](https://msk-access.gitbook.io/sequence-qc/)## InstallationFrom pypi:pip install sequence_qcFrom conda:conda install -c ionox0 -c conda-forge -c bioconda sequence-qc
Package: sequencer
Thesequenceris an engine used by system administrators for the
computation and execution of sequences of actions over hardware or
software (for example powering on/off a whole cluster or a data-
center).The sequencer is made of three different stages for:the computation of dependency graphs;the computation of instructions sequences;the execution of instructions sequences.Each stage can be called separately (in an incremental execution
mode), or chained together (blackbox execution mode). Both modes have
their use in real life. Incremental mode allows the end user to
validate dependency graph and/or instructions sequence before putting
it on production for its actual execution. This is done for an
Emergency PowerOff (EPO) instructions sequence for example. The
blackbox mode is used for simple usage such as powering on/off small
subset of clusters or data centers.Home page:http://vigneras.github.com/sequencer/Contact:http://vigneras.github.com/sequencer/index.html#contact
Package: sequences
sequencesThis is a simple Mathematical Module which is easy to use. The module provides many of the most famoussequencesfrom the On-Line Encyclopedia of International Sequences (OEIS) as Python Functions that return alistof the first 'n' terms of that sequence. Help text is included for each function so that the user gets an idea of what to expect as the output to each function.Examples of Functions providedwhole(n)[0, 1, 2, 3, ..., n]square(n)[0, 1, 4, 9, ..., pow(n, 2)]prime(n)[2, 3, 5, 7, 11, ...]composite(n)[4, 6, 8, 9, 10, ...]fibonacci(n)[0, 1, 1, 2, 3, ..., sum([F(n-1), F(n-2)])]tribonacci(n)[0, 1, 1, 2, 4, ..., sum([T(n-1), T(n-2), T(n-3)])]pascal(n):[[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1], ...]the nth row of Pascal's triangle (as a List)P(n) = comb(n, r) for r in range(n+1)look_say(n)[1, 11, 21, 1211, 111221, ...]T(n) = 0 if n == 0T(n) = int(word for T(n-1)) otherwiserecaman(n)[0, 1, 3, 6, 2, ...]T(n) = 0 if n == 0T(n) = T(n-1) - n if positive and not already in sequenceT(n) = T(n-1) + n otherwisevan_eck(n)[0, 0, 1, 0, 2, ...]T(n) = 0 if n == 0T(n) = 0 if T(n-1) is a new numberT(n) = x if T(n) occured x steps earlier in the sequenceAnd many more... Access the names of all the functions through dir() in python. Each function contains help text that can be accessed through help() in python to know more about it.Updates (0.0.5)Minor bug fixesUpdates (0.0.6)Added new sequences like:catalan(n)[1, 1, 2, 5, 14, ..., comb(2n, n) / (n+1)]aronson(n)[1, 4, 11, 16, 24, ...]these numbers are obtained from the index of english letter "T" or "t" in the sentence: "T is the first, fourth, eleventh, sixteenth, ... letter in this sentence." ignoring spaces and punctuation markscantral_polygon(n)[1, 2, 4, 7, 11, ..., (pow(n, 2) + n+2) / 2]Updates (0.0.7)Added new sequences like:lucas(n)[2, 1, 3, 4, 7, ..., sum([L(n-1) + L(n-2)])]negalucas(n)[2, -1, 3, -4, 7, ..., pow(-1, n) * L(n)]euclid_mullin(n)[2, 3, 7, 43, 13, ...]T(n) = 2 if n == 1T(n) = smallest prime factor of product(euclid_mullin(n)) + 1 otherwiseprime_powers(n)[2, 3, 4, 5, 7, ...]these numbers are of the form pow(x, n) where x is a prime and n is a positive integercentral_binomial(n)[1, 2, 6, 20, 70, ..., comb(2n, n)]semiprime(n)[4, 6, 9, 10, 14, ...]these numbers are the product of two primes not necessarily distinctAnd many more... Access the names of all the functions through dir() in python.Updates (0.0.8)Minor bug fixesReach out to meIf you face issues, contact me through my e-mail:knightt1821@gmail.com