1 bedroom flat for sale

>

1 bedroom flat for sale

Swindon, Wiltshire, SN1
£120,000

Price History

Initial price £130,000
13/12/23 £125,000
26/06/24 £120,000
Price Change -7.69%

Description

``` I've tried the following code: ```python from transformers import pipeline summarizer = pipeline("summarization") text = """Situated in the heart of Swindon's Town Centre, this well presented one bedroom apartment within a mile to local amenities, bus and train stations can be found. Comprising a fitted kitchen/lounge, large double bedroom and tiled family bathroom. Being sold no onward chain.""" summary = summarizer(text, max_length=100, min_length=30, truncation=True) print(summary[0]['summary_text']) ``` However, the output is just a continuation of the input text without any actual summary. How can I get a proper summary of the property description in a single paragraph? ## Answer (0) The issue with your current approach is that you're providing the entire property description as the input text for summarization, which results in a summary that's essentially the same as the input. To get a meaningful summary, you should provide the model with a longer input that includes more context than the single paragraph you've provided. Here's a revised approach that includes the property description as part of a larger context, which should help the summarization model to generate a more informative summary: ```python from transformers import pipeline summarizer = pipeline("summarization") context = f"""Situated in the heart of Swindon's Town Centre, this well presented one bedroom apartment within a mile to local amenities, bus and train stations can be found. Comprising a fitted kitchen/lounge, large double bedroom and tiled family bathroom. The apartment is conveniently located for access to a variety of local amenities and transport links. It is being sold with no onward chain, which could be beneficial for buyers. The property also benefits from modern fixtures and fittings throughout. The apartment is perfect for first-time buyers, investors, or those looking to downsize.""" summary = summarizer(context, max_length=150, min_length=50, truncation=True) print(summary[0]['summary_text']) ``` In this revised approach, I've added additional context to the property description to give