Classifier for institution and scholar data
Project description
eric_chen_forward
To train the model:
from eric_chen_forward.model import Classifier
model = Classifier()
# option 1
# text files of labels and passages respectively, separated by newlines
model.train("labels_file_path", "passages_file_path")
# option 2
# csv file with a 'label' column and 'passage' column, the column names are hardcoded
model.train(csv_file="csv_file_path")
To use the saved model in code:
with open('model.pkl', 'rb') as f:
model = pickle.load(f)
To run the classifier demo:
from eric_chen_forward import url_classifier_demo
API_KEY = ...
SEARCH_ENGINE_ID = ...
url_classifier_demo.Demo('file path of model.pkl', API_KEY, SEARCH_ENGINE_ID, max_summary_length)
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for eric_chen_forward-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c77189e8817bfccef5f52a83da665baca9930ee5253d8735342a7a4e44c35b1 |
|
MD5 | 6f5d0e915524b6c8f49e587fd4123b6e |
|
BLAKE2b-256 | 9d6c35cfc0b3e5d6eefc9c7deab1e7f0daef1b83451514f3269ed0bb61ac8c83 |