common-voice/cv-sentence-extractor

Problem with one/two sentences articles

AG12r opened this issue · 4 comments

AG12r commented

When an article contains only one or two sentences (strings), filters are not working at all. There are too many numbers, line breaks, incomplete sentences in the results. Can this be avoided?
Scrtpng

Nice catch, that's interesting. Can you provide the following? Then I'll have a look what exactly is going wrong here.

  • Can you give me the marked lines in text form?
  • Can you give me the current rules file you are using?

Apart from the numbers and line breaks, did you notice any other errors? Can you elaborate what exactly you mean by "incomplete sentences"?

Thanks!

AG12r commented

Apart from the numbers and line breaks, did you notice any other errors?
Can you elaborate what exactly you mean by "incomplete sentences"?

I meant, that the text is extracted "as is", with all disallowed symbols. There are one-word sentences, without punctuation marks (because splitting on the newline character, as I guess).

Here are the text files. Thank you.
georgian-rules.zip

Thanks for the files. What I did:

  • Downloaded the zip and extracted it (in the Downloads folder)
  • Moved the georgian.toml to the rules directory of my local scraper source
  • Ran the following command: cargo run -- extract -l georgian -d ~/Downloads/georgian-rules/

This resulted in the following:

Loading rules at "./src/rules/georgian.toml"
Using Rules Rules { min_trimmed_length: 6, min_word_count: 3, max_word_count: 14, min_characters: 8, may_end_with_colon: false, quote_start_with_letter: true, needs_punctuation_end: true, needs_uppercase_start: false, needs_letter_start: true, allowed_symbols_regex: "[ა-ჰ„“,;:–  —\\-\\?\\.!]", disallowed_symbols: [], disallowed_words: {}, broken_whitespace: [String("  "), String(" ,"), String(" ."), String(" ?"), String(" !"), String(" ;"), String(" :"), String("„ "), String(" “"), String("„“"), String("“-"), String(" -"), String("- ")], abbreviation_patterns: [String("ძვ\\.|ჩვ\\.|მდ\\.|სოფ\\.|დას\\.|მაგ\\.|სახ\\.|კულტ\\.|ავტ\\.|პროფ\\.|მიახლ\\.|დაახლ\\.|დაახ\\.|ლათ\\.|გერ\\.|ინგლ\\.|ინგ\\.|ბერძ\\.|გრ\\.|კგ[ \\.\\-]|კმ[ \\.\\-]|მ[ \\.\\-]|სმ[ \\.\\-]|მმ[ \\.\\-]|წმ[ \\.\\-]|წთ[ \\.\\-]|წწ[ \\.\\-]|პრ[ \\.\\-]|ცკ[ \\.\\-]|მგუ[ \\.\\-]|სტუ[ \\.\\-]|თსუ|აგგ|აშშ|სსრ|სკკ|სფფ|ირბ|ნბა|დსთ|დმპ|რსფ|რპფ|ჩკპ|გდრ|დნმ|დნკ|ეცბ|შპს"), String(";$"), String("(^[ა-ჰ]{1}[\\s\\.\\?!;:„“])|(\\s[ა-ჰ]{1}[\\s\\.\\?!;:„“])")], replacements: [Array([String("და სხვ."), String("და სხვა.")])], even_symbols: [] }
Using disallowed_word_file = false
file_name = "/Users/mkohler/Downloads/georgian-rules/wiki_40"
მზადდება ჯიხვის, ხარის, კამეჩის, გარეული თხისა და სხვა ცხოველების რქისაგან.
რქას გამოხარშავენ, გაასუფთავებენ და გათლიან, შემდეგ მოჭედავენ ან მოაჩუქურთმებენ.
ყანწს სასმისად იყენებენ ქორწილებსა და ნათლობა-დღესასწაულებზე, განსაკუთრებით პოპულარულია აღმოსავლეთ საქართველოში.
ალაზანი გადალახა, მიეპარა ლეკთა ყარაულებს და ხმლით გაიკაფა გზა ციხისაკენ.
ნურსალ-ბეგმა ქართლ-კახეთის წინააღმდეგ მთელი დაღესტანი და ჭარ-ბელაქანი დარაზმა.
რაზმმა ციხეში დიდძალი თოფის წამალი შეიტანა.
დავითი, როგორც ჩანს, ადრევე სარგებლობდა ყივჩაყთა დახმარებით.
დავითმა მათთან ელჩობა გაგზავნა და საქართველოში გადმოსახლება და მის სამსახურში ჩადგომა შესთავაზა.
საქართველოს ლაშქრობებში მათ მნიშვნელოვანი როლი შეასრულეს.
avg chars per sentence = 74.88888888888889
count = 9

Given your previous comment I would have expected to see those numbers as well. Are you on the latest version of the script?

AG12r commented

I have just tried to re-download it again and now works fine. Thanks for your help! I will close the issue then.