Python Forum

Full Version: adding the customize dataset to BERT
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to summarize our training documents by using BERT model.
I tried with the code below but the result looks not the best.
So, I want to add the customized dataset to drive the result like I want.
Could anyone help me?
pip install bert-extractive-summarizer
pip install sacremoses
from summarizer import Summarizer
model = Summarizer()
with open('readme.txt') as f:
    contents = f.read()
string = model(contents)
Thanks.
Could anyone give me the instruction on this matter?
pip is used from command line, not from within a python script
so run first two lines from command line, and remove from script

then you also need to import bert-extractive-summarizer: from summarizer import Summarizer into your script

the examples are extensive here: https://github.com/dmmiller612/bert-extr...summarizer
and here for sacremoses: https://github.com/isi-nlp/sacremoses