Questions tagged [python-pattern]

Web mining and NLP module for Python, with tools for scraping, natural language processing, machine learning, network analysis and visualization.

Pattern is a web mining and NLP module for Python. It has tools for:

  • Data Mining: web services (Google, Twitter, Wikipedia), web crawler, HTML DOM parser
  • Natural Language Processing: part-of-speech taggers, n-gram search, sentiment analysis, WordNet
  • Machine Learning: vector space model, clustering, classification (KNN, SVM, Perceptron)
  • Network Analysis: graph centrality and visualization.

It is well documented, thoroughly tested with 350+ unit tests and comes bundled with 50+ examples. The source code is licensed under BSD and available from http://www.clips.ua.ac.be/pages/pattern.

10 questions
2
votes
3 answers

What is the best practice to give a namespace for a bunch of static methods?

I need a namespace within a module for many different static methods doing similar jobs. From my research I learnt that having a class full of static methods is considered anti-pattern in Python programming: class StatisticsBundle: @staticmethod …
Jinghui Niu
  • 990
  • 11
  • 28
1
vote
4 answers

split string based on pattern python

I am trying to delete a pattern off my string and only bring back the word I want to store. example return 2022_09_21_PTE_Vendor PTE 2022_09_21_SSS_01_Vendor SSS_01 2022_09_21_OOS_market…
Amr Mashrah
  • 177
  • 13
1
vote
0 answers

How can i install pattern library in pattern?

ImportError: Pattern library is not installed. Pattern library is needed in order to use lemmatize function This is what the error was shown while i'm using python. def process_texts(texts): texts = [[word for word in line if word not in stops]…
1
vote
1 answer

How to convert a Text object from a parsetree output of module Pattern in python?

I have a list of words like this: ['Urgente', 'Recibimos', 'Info'] I used the parsetree (parsetree(x, lemmata = True) function to convert the words and the output for each Word is…
1
vote
1 answer

Pattern web unable to locate elements by class names

I'm trying to identify DOM elements by class name, but I'm not able to use the pattern.web as described in the docs (I'm also running code that I've used before, so it did work at some point). from pattern.web import DOM html =…
A User
  • 812
  • 2
  • 7
  • 21
1
vote
0 answers

(pattern, nlp) ValueError: numpy.dtype has the wrong size, try recompiling

I have been trying to install a Reddit scraper (Python w/ Pattern / NLP https://github.com/jaijuneja/reddit-nlp) but I keep having the problem of my Numpy being incompatible. I've tried to uninstall and re-install Numpy, Pattern, Python... Any idea…
PG124
  • 9
  • 2
0
votes
2 answers

Python pattern search return only inside quotes

need help with the output. As of now it outputs the entire line import re pattern = re.compile('Computer([0-9]|[1-9][0-9]|[1-9][0-9][0-9])Properties') with open("Test.xml") as f: for line in f: if pattern.search(line): …
Amr Mashrah
  • 177
  • 13
0
votes
2 answers

replace specific pattern by using regular expression in python

I am trying to sort out specific paragraph by using regular expression in python. here is an input.txt file. some random texts (100+ lines) bbb ... ttt some random texts ccc ... fff paragraph_a A_story( ... some random texts…
Parine
  • 71
  • 6
0
votes
1 answer

How to create a animated patterns in python on console (or terminal)?

I am trying to animate the below diamond pattern in such a way that, It will first print the centre "star" and then its 4 neighbours and so on. * * …
Vishal T
  • 49
  • 7
0
votes
2 answers

How to print pattern with number of rows input by user

a = ['*','#','$'] b = [1,4,7] How can I make use of the above lists and loop to print the pattern with the required number of rows? Here are 2 examples if the input is 5 and 10 respectively. Do not need to print the bracket on each line.…