semvec/pypi-packages huggingface dataset:
cleancc 0.1.0
Data list cleaning

﻿## 数据清洗--cleancc

---

### cleancc
- 快速清洗数据内容可以
- 项目地址(欢迎star):[https://github.com/Amiee-well/clean](https://github.com/Amiee-well/clean)

### 使用方法
- pip install cleancc

- import cleancc

- 共有五个函数调用：

  1.第一个函数为punct：

  [

  ​	去除标点并让所有字母小写

  ​    :param pop_list:所要处理的的列表格式

  ​    :param lower:是否转小写，默认是

  ​    :return all_comment:处理后的结果-字符串格式

  ]

   2.第二个函数为statistics：

   [

  ​	词频统计

  ​    :param pop_list:所要处理的的列表格式

  ​    :param symbol:是否去除标点，默认是

  ​    :param lower:是否转小写，默认是

  ​    :return wordCount_dict:统计结果-字典格式

  ]

  3.第三个函数为stop_words：

  [

  ​	删除词频统计中的停顿词

  ​    :param statis:是否选择词频清理

  ​    :param pop_list:所要处理的的列表格式

  ​    :param symbol:是否去除标点，默认是

  ​    :param lower:是否转小写，默认是

  ​    :param wordCount_dict:词频统计结果-字典

  ​    :return wordCount_dict:清除后结果-字典格式

  ]

  4.第四个函数为Count_Sort：

  [

  ​	字典排名数目排序

  ​    :param wordCount_dict:词频统计结果-字典

  ​    :param choices_number:返回前choices_number个字典个数

  ​    :return keyword_list:出现的单词-列表格式

  ​    :return value_list:单词对应的词频-列表格式

  ]

  5.第五个函数为word_all：

  [

  ​	调用全部函数

  ​    :param pop_list:所要处理的的列表格式

  ​    :param choices_number:返回前choices_number个字典个数

  ​    :param symbol:是否去除标点，默认是

  ​    :param lower:是否转小写，默认是

  ​    :return keyword_list:出现的单词-列表格式

  ​    :return value_list:单词对应的词频-列表格式

  ]
### 注意事项
- 注意:处理数据参数类型为列表，需要pandas转换为列表后进行调用！

- 使用示例:
```python
import pandas as pd
from cleancc import clean 
from bs4 import BeautifulSoup

df = pd.read_csv("label.csv",sep='\t', escapechar='\\')
review_list = df['review'].tolist()
comment_list = [BeautifulSoup(k,'lxml').text for k in review_list]
print(comment_list)

keyword_list, value_list = clean.word_all(comment_list,150)
print(keyword_list, value_list)
```
unsserv 0.0.5
P2P out-of-the-box high-level library
Requires Python: >=3.7
Keywords: unsserv p2p unstructured membership network clustering bias aggregation sampling search dissemination broadcast pubsub

# py-unsserv
[![PyPI version](https://badge.fury.io/py/unsserv.svg)](https://badge.fury.io/py/unsserv)
[![Python 3.7](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/downloads/release/python-370/)
[![Build Status](https://travis-ci.com/aratz-lasa/py-unsserv.svg?branch=master)](https://travis-ci.com/aratz-lasa/py-unsserv)
[![codecov](https://codecov.io/gh/aratz-lasa/py-unsserv/branch/master/graph/badge.svg)](https://codecov.io/gh/aratz-lasa/py-unsserv)

[![PEP8](https://img.shields.io/badge/code%20style-pep8-orange.svg)](https://www.python.org/dev/peps/pep-0008/)
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)

**py-unsserv** is high-level Python library, designed to offer out-of-the-box peer-to-peer (p2p) 
network, as well as a bunch of functionalities on top of it. These functionalities include:
- Membership (or p2p network creation)
- Clustering
- Metrics aggregation
- Nodes sampling
- Dissemination (or broadcasting) 
- Data searching (key-value caching oriented)

**Look how easy it is to use:**
```python
import asyncio
from typing import Tuple

from unsserv import join_network, get_dissemination_service

Host = Tuple[str, int]


async def broadcaster(host: Host):
    # join p2p network
    membership = await join_network(host, "network.id")
    # initialize dissemination service
    dissemination = await get_dissemination_service(membership, "dissemination.id")
    # wait for receiver to join network
    await asyncio.sleep(1)
    # broadcast data
    for _ in range(10):
        await dissemination.broadcast(b"data.alert")
        await asyncio.sleep(1)


async def receiver(host: Host, broadcaster_host: Host):
    # wait for broadcaster to join network
    await asyncio.sleep(1)
    # join p2p network
    membership = await join_network(host, "network.id", bootstrap_nodes=[broadcaster_host])
    # initialize dissemination service and add broadcast handler
    async def handler(data: bytes):
        print(data)
    await get_dissemination_service(membership, "dissemination.id", broadcast_handler=handler)
    # wait for broadcast
    await asyncio.sleep(10)


if __name__ == "__main__":
    broadcaster_host = ("127.0.0.1", 7771)
    receiver_host = ("127.0.0.1", 7772)

    loop = asyncio.new_event_loop()
    loop.create_task(broadcaster(broadcaster_host))
    loop.create_task(receiver(receiver_host, broadcaster_host=broadcaster_host))
    loop.run_forever()
```

## Installation
```bash
pip install unsserv
```

## More about UnsServ
**py-unsserv** is the Python implementation of UnsServ, which is the academic work behind it.
For a more detailed understanding you can check the UnsServ non-published paper: 
[Original UnsServ academic paper](https://aratz.lasa.eus/file/unsserv.pdf)