MétaCan
Menu
Retour à la cohorte
Enregistrement W116427613

Extract and parse ODF files with Python

2007· article· en· W116427613 sur OpenAlexaboutno aff
Kamran Husain

Notice bibliographique

RevueLinux journal · 2007
Typearticle
Langueen
DomaineComputer Science
ThématiqueComputational Physics and Python Applications
Établissements canadiensnon disponible
Organismes subventionnairesnon disponible
Mots-clésPython (programming language)Computer scienceOperating systemInstallationMicrosoft OfficePlug-inPerlWorld Wide WebSoftwareProgramming language
DOInon disponible

Résumé

récupéré en direct d'OpenAlex

Use Python to demystify Open Document Format files. The Open Document Format (ODF) Alliance is designed for sharing information between different word processing applications. This article highlights the basic structure of ODF files, some internals of the underlying XML files and shows how to use Python to read the contents to perform a simple search for keywords. The code also can be the basis for more-advanced operations. In the spirit of openness, we use open-source software to read the ODF files, which in this case are Python and the OpenOffice.org package. If you are running a recent version of Linux or OS X, you already should have Python and OpenOffice.org installed on your machine. If you need the latest versions, Python is available for free from http://www.python.org for both the Windows and Linux platforms. The OpenOffice.org package also is available for free from http://www.openoffice.org. Installing OpenOffice.org on an XP desktop is relatively painless. Download the packages from their respective sites and run the installer. Once installed, simply run the application from the desktop with a click on the installed icons. Tip: Most folks do have Microsoft Office installed. If that's the case, the solution is to use a plugin for Microsoft Word (http://sourceforge.net/projects/odf-converter). You can install both the OpenOffice.org and Microsoft packages on the same machine without causing any conflicts. Please read the Bugs section on the SourceForge site for any incompatibilities before you install the plugin. I used the OpenOffice.org suite to save the files for this article, because it was easier. Once you have confirmed that you have the prerequisites, you can create an ODF file. Open up the Writer, type some text in a document and save it. You can read in a file and save it as an .odt file. A quick look at extensions in the Save dialog reveals a lot. An ODF file can have many extensions, which provide a clue as to the type of information stored in it and the application that stored it. See Table 1. Table 1. Table 1. ODF File Types and Their Extensions Document Format File Extension OpenDocument Text *.odt OpenDocument Text Template *.ott OpenDocument Master Document *.odm Extract and Parse ODF Files with Python http://0-delivery.acm.org.innopac.lib.ryerson.ca/10.1145/1250000/12... 2 of 8 8/27/2007 8:09 PM Document Format File Extension HTML Document *.html HTML Document Template *.oth OpenDocument Spreadsheet *.ods OpenDocument Spreadsheet Template *.ots OpenDocument Drawing *.odg OpenDocument Drawing Template *.otg OpenDocument Presentation *.odp OpenDocument Presentation Template *.otp OpenDocument Formula *.odf OpenDocument Database *.odb So, what's in an ODF file? An ODF file is basically a zipped archive with several XML files. The actual files and directories in a file will vary depending on the type of information and the system on which the document was created. The first step in picking out the names of the files in an ODF file requires unzipping the file itself. Fortunately, Python has built-in support for dealing with this endeavor with the zipfile module. Type python on the command line to run an interactive shell. Running a shell allows you to examine the contents of objects returned from the modules. Because you'll probably be doing this only once per type of data, there is really no need to write and execute a script at this time. If you want to preserve the work for future use, it's better to write a script in a text editor or use the IDLE editor that comes with Python and save the script. See Listing 1 on how to show the member functions in a class or module. Listing 1. Showing the Member Functions in a Class or Module Python 2.4.1 (#65, Mar 3

Récupéré en direct depuis OpenAlex et désinversé. Les résumés ne sont pas conservés dans cette base de données : les index inversés représentent 8,6 Go des 9,3 Go de texte de la base, et le serveur dispose de 13 Go libres.

Comment cette classification a été obtenuedéplier

Prédiction machine sur la base complète

Imitation des enseignants

Ni prévalence calibrée, ni vérité terrain. Validation humaine à venir. Le volet Gemma est une étiquette directe du modèle pour chaque travail de la base, lue sur la notice réduite au titre. Le volet Codex est un classifieur appris des 10 348 étiquettes directes de Codex et calibré sur les taux pondérés de l'échantillon; les champs sans appui suffisant ne portent aucun appel Codex. Le mode candidate est l'union des deux volets; le consensus est leur intersection. Ces sorties portent le statut machine_predicted_unvalidated et ne sont pas des étiquettes humaines.

score de la tête « metaresearch » (Codex)0,002
score de la tête « metaresearch » (Gemma)0,014
Version: metacan-v3-hybrid-931329e0061cStatut de validation: machine_predicted_unvalidated
Catégories candidatesaucune
Catégories consensuellesaucune
DomaineSignal candidat: aucune · Signal consensuel: aucune
Devis d'étudeSignal candidat: Sans objet · Signal consensuel: Sans objet
GenreSignal candidat: Méthodes · Signal consensuel: aucune
Score de désaccord entre enseignants0,136
Score d'incertitude au seuil0,456

Scores du classifieur distillé par catégorie (deux têtes)

CatégorieCodexGemma
Métarecherche0,0020,014
Méta-épidémiologie (sens strict)0,0030,002
Méta-épidémiologie (sens large)0,0010,003
Bibliométrie0,0060,004
Études des sciences et des technologies0,0020,001
Communication savante0,0050,005
Science ouverte0,0030,005
Intégrité de la recherche0,0010,003
Charge utile insuffisante (le modèle a refusé de juger)0,1360,171

Scores machine (provisoires)

Les deux têtes enseignantes du modèle étudiant, lues sur ce travail. Un score ordonne la base pour la relecture; il n'affirme jamais une catégorie, et le statut de validation accompagne chaque rangée tel quel.

Scores de référence d'un modèle non mature (critères de maturité non atteints, 7 itérations). Un score ordonne; il n'affirme jamais une catégorie.

Tête enseignante Opus0,014
Tête enseignante GPT0,260
Écart entre enseignants0,246 · la distance entre les deux têtes enseignantes sur ce seul travail
Statut de validationscore_only:v0-immature-baseline · tel quel depuis la passe de notation : score_only signifie que le nombre peut ordonner les travaux, et qu'aucune étiquette de catégorie n'en découle

Classification

machine, non validée

Prédiction automatique; un appel candidat d’une seule source (Gemma direct ou Codex distillé), pas un consensus.

Les modèles n’ont appliqué aucune catégorie : rien dans la taxonomie ne correspondait à ce travail.
Devis d'étudeSans objet
Domainenon disponible
GenreMéthodes

Le détail, modèle par modèle et score par score, se trouve en fin de page sous « Comment cette classification a été obtenue ».

En bref

Citations0
Publié2007
Routes d'admission1
Résumé présentoui

Explorer davantage

Même revueLinux journalMême sujetComputational Physics and Python ApplicationsTravaux en français237 207