Skip to content

Commit

Permalink
🚧 fix(docs): update example in README
Browse files Browse the repository at this point in the history
  • Loading branch information
mxchinegod committed Jan 4, 2024
1 parent fbccb68 commit 491bbbc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,18 @@ python3 setup.py install

``` python
from magnet.ize.filings import Processor
# your text documents data
source_data_file = "./raw/export.parquet"
source_data_file = "./raw/filings.csv"
export_data_file = "./data/filings_mistral_nlp.parquet"
filings = Processor()
filings.load(source_data_file)
# output, text column, id column, and we disable sentence splitting for fastest processing
await filings.process('./data/filings.parquet','clean','file', nlp=False)
filings.load(
source_data_file
, 'clean'
, 'file'
)
await filings.process(
export_data_file
, nlp=True
)
```

<img src='./divider.png' style="width:100%;height:5px;">
Expand Down
20 changes: 20 additions & 0 deletions magnet/utils/nats.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from magnet.utils.globals import _f

def error_cb(error, connection):
_f('info', connection)
_f('error', error)

def closed_cb(error, connection):
_f('info', connection)
_f('warn', "connection closed")

def discovery_cb(error, connection):
_f('info', connection)
_f('info', "server found")

def reconn_cb(error, connection):
_f('info', connection)
_f('warn', "reconnected")

def stats(connection):
return connection.stats

0 comments on commit 491bbbc

Please sign in to comment.