Skip to main content

SO text processing

Project description

# Python module for string matching ONLY TESTED WITH PYTHON 3.5+.

# Installation ` pip install so-processing `

# Usage ` df = pd.read_parquet('sse.parquet') ` Text is stemmed and preprocessed

postid | tags | title | question | answers |
—— | —————- | —————————————— | ———————————————————— | ———————————————————— |
12041 | javascript|html | are “man in the middle” attack extrem rare | i am wonder if there is any cold hard real world data to back up that assert – are man in the middl attack actual rare in the real world base on gather data from actual intrus or secur incid | my favorit current resourc for cold hard real world data is the verizon 2011 data breach investig report an excerpt from page 69 of the report action the top three threat action categori were hack malwar and social the most common type of hack action use were the use of stolen login credenti exploit backdoor and man-in-the-middl attack from read that i infer that its a secondari action use onc somebodi has a foothold in the system but the dutch high tech crime unit data say its quit credibl for concern of the 32 data breach that made up their statist 15 involv mitm action |

` import so_textprocessing as stp tp = stp.TextPreprocess(strlist='targetwords.txt') df = tp.transform_df(df) ` Adds new columns. transform_df() uses reformat=’summary’ by default.

postid | tags | title | question | answers | uniq | raw | words | len | ratio |
—— | —————- | —————————————— | ———————————————————— | ———————————————————— | —- | —- | ——————————————————- | —- | —— |
12041 | javascript|html | are “man in the middle” attack extrem rare | i am wonder if there is any cold hard real world data to back up that assert – are man in the middl attack…. | my favorit current resourc for cold hard real world data is the verizon 2011 data… | 4 | 7 | man in the middle| attack|malware |man-in-the-middle | 151 | 0.0463 |

# Reformat Options `df = tp.transform_df(df, reformat='raw')` returns raw aho-corasick output

`df = tp.transform_df(df, reformat='index')` returns raw string matches with start/end indexes

`df = tp.transform_df(df, reformat='words')` returns list of raw words (as orignal, unstemmed words)

`df = tp.transform_df(df, reformat='summary')` (default): returns unique_count, raw_count, words, len and ratio. Only keeps longest string if a substring exists. e.g. ‘time bomb’ will only count ‘time bomb’ and not ‘bomb’.

`df = tp.transform_df(df, reformat='full')` same as summary, but when used in transform_df, it also processes+stems the text of the dataframe. Slowest option.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

so_processing-0.2.tar.gz (19.7 kB view details)

Uploaded Source

File details

Details for the file so_processing-0.2.tar.gz.

File metadata

  • Download URL: so_processing-0.2.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4

File hashes

Hashes for so_processing-0.2.tar.gz
Algorithm Hash digest
SHA256 4c9f9b6cbdaa8f5f3dfb08da0af791331f422066793dd64af9011cbd9f35186b
MD5 3ee9a30884ce01906b7cd1cedcbbc7e0
BLAKE2b-256 21c895ad709aa2ab3192dfc0a8a36935f19bc0e565a10afd5757c7682a9e4fad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page