from transformers import AutoTokenizer, AutoModel import torch from nltk.tokenize import sent_tokenize import numpy as np from sklearn.metrics.pairwise import cosine_similarity
# 示例超长句子 sentence1 = """ Apple Inc. announced a 4-for-1 stock split during its Q3 earnings call, citing the desire to make shares more accessible to a broader base of investors. The company also reported a 15% year-over-year increase in revenue, driven by strong sales of the iPhone 12 and growth in services like Apple Music and iCloud. CEO Tim Cook emphasized the company's commitment to returning value to shareholders through increased dividends and share buybacks. """
sentence2 = """ In response to inflationary pressures, the Federal Reserve raised the benchmark interest rate by 0.5 percentage points, marking the largest hike in over two decades. Chair Jerome Powell indicated that further rate increases are likely throughout the year to combat rising consumer prices. Analysts predict this move will impact borrowing costs for businesses and consumers, potentially slowing economic growth in the near term. """