eric-chen-forward-0.0.9
توضیحات
Classifier for institution and scholar data
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | eric-chen-forward-0.0.9 |
| نام | eric-chen-forward |
| نسخه کتابخانه | 0.0.9 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Eric Chen <ezchen2556@gmail.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/eric-chen-forward/ |
| مجوز | - |
# eric_chen_forward
To train the model:
```python
from eric_chen_forward.model import Classifier
# alpha parameter used in data augmentation, 0.2 by default
model = Classifier(alpha=0.2)
# option 1
# text files of labels and paragraphs respectively, separated by newlines
# model_type is 'SVM' by default, you can use 'LR' for logistic regression
model.train(labels_file="labels_file_path", paragraphs_file="paragraphs_file_path", model_type='SVM')
# option 2
# csv file must have a 'label' column and 'paragraph' column only, and the column names are hardcoded
model.train(csv_file="csv_file_path", model_type='LR')
```
To use the saved model in code:
```python
with open('model_name.pkl', 'rb') as f:
model = pickle.load(f)
```
To run the classifier demo:
```python
from eric_chen_forward import url_classifier_demo
API_KEY = [paste api key here]
SEARCH_ENGINE_ID = [paste search engine ID here]
url_classifier_demo.Demo('file path of model.pkl', API_KEY, SEARCH_ENGINE_ID, max_summary_length=100)
```
max_summary_length is set to 100 words by default.
Register an API Key and set up the Programmable Search Engine to be able to use the Google Custom Search API: https://developers.google.com/custom-search/v1/overview
After setting up, the Search engine ID can also be found in the control panel: https://programmablesearchengine.google.com/controlpanel/all
نیازمندی
| مقدار | نام |
|---|---|
| - | beautifulsoup4>=4.11.1 |
| - | lxml>=4.9.1 |
| - | nltk>=3.7 |
| - | numpy>=1.23.3 |
| - | pandas>=1.5.0 |
| - | scikit-learn>=1.1.2 |
| - | spacy-legacy>=3.0.10 |
| - | spacy-loggers>=1.0.3 |
| - | spacy>=3.4.1 |
| - | streamlit>=1.12.2 |
| - | torch>=1.13.1 |
| - | trafilatura>=1.3.0 |
| - | transformers>=4.26.1 |
| - | watchdog>=2.1.9 |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl eric-chen-forward-0.0.9:
pip install eric-chen-forward-0.0.9.whl
نصب پکیج tar.gz eric-chen-forward-0.0.9:
pip install eric-chen-forward-0.0.9.tar.gz