{"id":13740726,"url":"https://github.com/vchahun/gv-crawl","last_synced_at":"2025-04-11T20:42:59.137Z","repository":{"id":8680960,"uuid":"10340517","full_name":"vchahun/gv-crawl","owner":"vchahun","description":"Global Voices bitext crawler","archived":false,"fork":false,"pushed_at":"2014-10-20T06:35:14.000Z","size":153,"stargazers_count":9,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T16:51:30.987Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vchahun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-28T16:54:50.000Z","updated_at":"2020-05-03T02:02:54.000Z","dependencies_parsed_at":"2022-09-11T04:20:12.114Z","dependency_job_id":null,"html_url":"https://github.com/vchahun/gv-crawl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vchahun%2Fgv-crawl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vchahun%2Fgv-crawl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vchahun%2Fgv-crawl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vchahun%2Fgv-crawl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vchahun","download_url":"https://codeload.github.com/vchahun/gv-crawl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248479592,"owners_count":21110916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T04:00:51.626Z","updated_at":"2025-04-11T20:42:59.107Z","avatar_url":"https://github.com/vchahun.png","language":"Python","funding_links":[],"categories":["Software"],"sub_categories":["Utilities"],"readme":"# Parallel text extraction from Global Voices\n\n[Global Voices](http://globalvoicesonline.org) is a community of bloggers and citizen journalists writing and translating news articles in several languages. We crawl articles from this website to create parallel corpora for low-resource languages.\n\n## Requirements\n\nPython 2.7 is required. Install dependencies with:\n\n    pip install -r requirements.txt\n\n## Step 1 (up to 1 week): crawl articles from the website\n\nWe can obtain seed URLs from the RSS feeds. It is recommended to add more seeds at different starting dates if starting to crawl from scratch. The crawler will follow the previous and next article links on each page.\n\nFor example, to crawl the [Malagasy version](http://mg.globalvoicesonline.org) of the website, run:\n\n\tmkdir crawl-mg\n\tcurl http://mg.globalvoicesonline.org/feed/ | python gv-crawl/make_seeds.py \u003e crawl-mg/seeds.txt\n\tpython gv-crawl/crawler.py crawl-mg/seeds.txt crawl-mg --delay 1 2\u003e crawl-mg/crawl.log\n\nThe crawling can be interrupted and restarted; it should resume operation automatically. This also makes incremental crawling possible.\n\nCompressed WARC files containing the crawled pages are created.\n\n## Step 2: create article database\n\nAfter we have crawled several versions of the website, we can find parallel documents for a pair of languages. Fist, we insert all articles in a database (repeat for all languages):\n\n    python gv-crawl/warc2db.py ./crawl-mg/scrapy.*.warc.gz articles.db\n\n## Step 3: sentence alignment\n\nThen, we use the [Gargantua sentence aligner](http://sourceforge.net/projects/gargantua/) to align the sentences from parallel articles:\n\n\tpython gv-crawl/db2bidoc.py en mg articles.db $GARGANTUA\n\tcd $GARGANTUA \u0026\u0026 mkdir corpus_data \u0026\u0026 cd corpus_data \u0026\u0026 ../src/sentence-aligner\n\nThe `db2bidoc.py` creates the tokenized/untokenized/info files necessary for Gargantua to run in the `$GARGANTUA` directory. These intermediary files (`corpus_data, corpus_to_align, input_documents`) can be deleted after the last step has been run.\n\n## Step 4: create aligned XML bitext\n\nFinally, an XML file containing the bitext is created:\n\n\tpython gv-crawl/align2xml.py eng mlg\\\n\t\t$GARGANTUA/corpus_to_align/align_info.txt\\\n\t\t$GARGANTUA/corpus_data/output_data_aligned \u003e en-mg.xml\n\nThis XML file can be processed with the [teny tools](https://github.com/vchahun/teny) to produce parallel text files.\n\n## License\n\nCopyright (c) 2013, [Victor Chahuneau](http://victor.chahuneau.fr/)\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvchahun%2Fgv-crawl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvchahun%2Fgv-crawl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvchahun%2Fgv-crawl/lists"}