mirror of
https://github.com/wassname/multifit.git
synced 2026-09-09 11:27:26 +08:00
Make the article detection code work with our wikitext
This commit is contained in:
@@ -35,7 +35,7 @@ class Tokenizers(Enum):
|
||||
FASTAI='f'
|
||||
|
||||
def istitle(line):
|
||||
return len(re.findall(r'^ = [^=]* = $', line)) != 0
|
||||
return len(re.findall(r'^ ?= [^=]* = ?$', line)) != 0
|
||||
|
||||
def read_wiki_articles(filename):
|
||||
articles = []
|
||||
@@ -48,6 +48,7 @@ def read_wiki_articles(filename):
|
||||
articles.append(current_article)
|
||||
current_article = ''
|
||||
articles.append(current_article)
|
||||
print(f"Wiki text was split to {len(articles)} articles")
|
||||
return pd.DataFrame({'texts':np.array(articles)})
|
||||
|
||||
@dataclass
|
||||
|
||||
Reference in New Issue
Block a user