<jupyter_start><jupyter_text>Original text<jupyter_code>input_text = data[DATA_ORIGINAL][TEST_INDEX]
print(input_text)<jupyter_output>b'Dollar gains on Greenspan speech\n\nThe dollar has hit its highest level against the euro in almost three months after the Federal Reserve head said the US trade deficit is set to stabilise.\n\nAnd <NAME> highlighted the US government\'s willingness to curb spending and rising household savings as factors which may help to reduce it. In late trading in New York, the dollar reached $1.2871 against the euro, from $1.2974 on Thursday. Market concerns about the deficit has hit the greenback in recent months. On Friday, Federal Reserve chairman Mr Greenspan\'s speech in London ahead of the meeting of G7 finance ministers sent the dollar higher after it had earlier tumbled on the back of worse-than-expected US jobs data. "I think the chairman\'s taking a much more sanguine view on the current account deficit than he\'s taken for some time," said <NAME>, head of currency strategy at Bank of America in New York. "He\'s taking a longer-term view, laying out a set of conditions [...]<jupyter_text>Actual summarized text from dataset<jupyter_code>actual_summarized_text = data[DATA_SUMMARIZED][TEST_INDEX]
print(actual_summarized_text)<jupyter_output>b'The dollar has hit its highest level against the euro in almost three months after the Federal Reserve head said the US trade deficit is set to stabilise.China\'s currency remains pegged to the dollar and the US currency\'s sharp falls in recent months have therefore made Chinese export prices highly competitive.Market concerns about the deficit has hit the greenback in recent months."I think the chairman\'s taking a much more sanguine view on the current account deficit than he\'s taken for some time," said <NAME>, head of currency strategy at Bank of America in New York.The recent falls have partly been the result of big budget deficits, as well as the US\'s yawning current account gap, both of which need to be funded by the buying of US bonds and assets by foreign firms and governments."He\'s taking a longer-term view, laying out a set of conditions under which the current account deficit can improve this year and next."'<jupyter_text>Summarized text<jupyter_code>summary = summarizer.predict(input_text)
print(summary)<jupyter_output>China\'s currency remains pegged to the dollar and the US currency\'s sharp falls in recent months have therefore made Chinese export prices highly competitive. "He\'s taking a longer-term view, laying out a set of conditions under which the current account deficit can improve this year and next. The half-point window, some believe, could be enough to keep US assets looking more attractive, and could help prop up the dollar. The White House will announce its budget on Monday, and many commentators believe the deficit will remain at close to half a trillion dollars.\n' Market concerns about the deficit has hit the greenback in recent months. "\n\nWorries about the deficit concerns about China do, however, remain. In late trading in New York, the dollar reached $1.2871 against the euro, from $1.2974 on Thursday.<jupyter_text>Evaluation<jupyter_code>summarizer = ExtractiveSummarizer()

data_path = os.path.join(os.getcwd(), r"data\bbc_news.csv")
data = summarizer._load_data(data_path)
data
reference_data = data[DATA_ORIGINAL].sample(n=SAMPLE_SIZE, random_state=RANDOM_SEED)
reference_data
reference_summary = data[DATA_SUMMARIZED].sample(n=SAMPLE_SIZE, random_state=RANDOM_SEED)
reference_summary
candidate_data = reference_data.map(summarizer.predict)
candidate_data
precision, recall, f1 = summarizer.evaluation(preds=candidate_data, refs=reference_data)
print(f'Precision: {precision}')
print(f'Recall: {recall}')
print(f'F1: {f1}')
precision, recall, f1 = summarizer.evaluation(preds=candidate_data, refs=reference_summary)
print(f'Precision: {precision}')
print(f'Recall: {recall}')
print(f'F1: {f1}')<jupyter_output>calculating scores...
computing bert embedding.
{'fraction_non_alphanumeric': 0.06582215598609041, 'fraction_numerical': 0.0067064083457526085, 'mean_word_length': 5.848639455782313, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '483050', 'license': 'MIT', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1079, 'n_words': 506, 'path': 'notebooks/ExtractiveModel.ipynb', 'repo_name': 'dwszai/news-summarizer', 'size': '4048'}