403 Commits

Author SHA1 Message Date
John
c78c5b6adf
fix: page_number appears in partition_html metadata if include_metadata=False (#658)
* fix: page_number appears in partition_html metadata if include_metadata=False

* Update common.py

* Update CHANGELOG

---------

Co-authored-by: Matt Robinson <mrobinson@unstructured.io>
2023-05-30 20:47:55 +00:00
Matt Robinson
f7cde5539a
fix: page_number should not always be 1 in the metadata (#657)
* fix page number issue

* add tests

* changelog and version

* update changelog
2023-05-30 15:10:14 -04:00
wesleysanjose
b8dcf437ee
fix: add .log to list of TXT filetypes 2023-05-30 14:13:58 -04:00
Christine Straub
5b5fb3e13b
Issue/encoding error eml (#639)
This PR adds functionality to try other common encodings for email (.eml) files if an error related to the
encoding is raised and the user has not specified an encoding.
2023-05-30 10:24:02 -07:00
Matt Robinson
3e983efce3
docs: add feature table to README (#655)
* remove announcement

* add table with filetypes

* remove filetype specific examples

* remove line break

* remove easy gif

* fix extra whitespace
2023-05-30 15:56:25 +00:00
Yuming Long
66058e76bf
changelog and version (#645) 0.6.11 2023-05-26 22:21:16 -04:00
Yuming Long
fc59a043b7
Chore: Support epub tests in docker image (#630)
* docker works

* more epub tests

* changelog version

* support epub + odt + rtf

* update dockerfile

* revert..

* install pandoc on ci env

* pandoc docker grab bashed on arch

* move arch into image

* move back to base image
2023-05-26 15:38:48 -04:00
cragwolfe
c5d9469001
feat: add xls support (#632)
Add support for older .XLS files from the partition function in unstructured.partition.auto.

Note, this should also work on the centos7 unstructured image (with the requirements/*txt updates in this PR).
0.6.10
2023-05-26 01:55:32 -07:00
ryannikolaidis
b767f6b0ec
fix(ci): prevent gha caching conflicts (#643) 2023-05-25 17:20:28 -07:00
qued
c82bad1061
build(deps): avoid version conflicts (#636)
Addresses #631.

* Uses constraints to keep dependency versions more consistent.
* Moves all dependencies to .in files which are then ingested by setup.py.
* Adds script to check consistency of all extras.
* Adds consistency check to CI.

I should note that while it shouldn't be possible to cause a conflict between base.txt and any of the extras (because base.txt constrains all the extras) it is possible to get a conflict between two of the extras files. There are ways of trying to avoid that (like constraining each file by all the files that have already been processed before it in the order given in the make pip-compile target) but the ones I could think of seemed a little overwrought, and come with problems of their own. If a conflict arises, it should be flagged by CI or locally with make check-deps. When/if that happens, you can resolve the conflict by adding appropriate global constraints in requirements/constraints.txt.

Also note that if fileA.in is constrained by fileB.txt, then fileB.in should be compiled before fileA.in in the make pip-compile target. Otherwise fileA.in will be compiled with the old version of fileB.txt which can cause conflicts or keep dependencies from being updated properly.
0.6.9
2023-05-24 22:29:35 +00:00
Christine Straub
a1fed6d4c6
Issue/unicode error (#608)
This PR adds functionality to try other common encodings if an error related to the encoding is raised and the user has not specified an encoding.
2023-05-23 13:35:38 -07:00
Trevor Bossert
a78719666a
Build using base image (#625)
This should speed up the builds a lot
2023-05-22 11:13:24 -07:00
qued
55e5d8ea2f
enhancement: include coords in fast (#626)
Makes the bounding box coordinates available when using fast strategy.

* Refactored partition_text to make the workflow of categorizing an element purely from the text available without running the entirety of partition_text.
* Transformed the coordinates from pdf space into pixel space to be consistent with hi_res. We will probably want to revisit the coordinate system soon.
2023-05-20 16:26:55 -05:00
Matt Robinson
fda51d6ead
fix: add more mime types for csv (#620) 2023-05-19 16:40:26 -05:00
Matt Robinson
21c821d651
feat: add partition_csv function (#619)
* add csv into filetype detection

* first pass on csv

* add tests for csv

* add csv to auto

* version bump

* update readme and docs

* fix doc strings
0.6.8
2023-05-19 15:57:42 -04:00
Matt Robinson
046af734d7
release: bump version for 0.6.7 release (#617) 0.6.7 2023-05-19 13:30:17 -04:00
Yuming Long
ab5f92dd79
Fix(ingest): Deprecate --s3-url in favor of --remote-url (#616)
* deprecation s3-url

* changelopg and versioin

* download dir not now
2023-05-19 12:11:40 -04:00
ryannikolaidis
7942bc9d5b
chore: refactor for ingest standard_config options (#599) 2023-05-18 16:49:30 -07:00
Matt Robinson
23ff32cc42
feat: add partition_xml for XML files (#596)
* first pass on partition_xml

* add option to keep xml tags

* added tests for xml

* fix filename

* update filenames

* remove outdated readme

* add xml to auto

* version and changelog

* update readme and docs

* pass through include_metadata

* update include_metadata description

* add README back in

* linting, linting, linting

* more linting

* spooled to bytes doesnt need to be a tuple

* Add tests for newly supported filetypes

* Correct metadata filetype

* doc typo

Co-authored-by: qued <64741807+qued@users.noreply.github.com>

* typo fix

Co-authored-by: qued <64741807+qued@users.noreply.github.com>

* typo fix

Co-authored-by: qued <64741807+qued@users.noreply.github.com>

* keep_xml_tags -> xml_keep_tags

---------

Co-authored-by: Alan Bertl <alan@unstructured.io>
Co-authored-by: qued <64741807+qued@users.noreply.github.com>
2023-05-18 15:40:12 +00:00
Matt Robinson
b6bfbf9108
fix: track filename in metadata for docx tables (#597)
* fix: track filename in metadata for docx tables

* bump version

* remove accidental commit
2023-05-18 10:20:38 -04:00
Meir
301cef27a4
feat: add page_name to metadata for Excel documents (#609)
* Add page_name to metadata for Excel documents

* Update changelog and version number

* fix lint
2023-05-18 13:53:23 +00:00
Mallori Harrell
34d563c1fc
feat: Create spacy notebook example (#593)
* add new notebook for spacy
2023-05-17 15:42:15 -05:00
Eu Jin Marcus Yatim
7eac1f8ca7
refactor: update detect_filetype() to use hashmap for mime type return (#591)
* Update detect_filetype() to use hashmap for mime type return

* fix: text mime type and linting

* fix: declare docx and xlsx mime types locally and also fix linting

* Update CHANGELOG.md

* tweaks for failing tests

---------

Co-authored-by: Matt Robinson <mrobinson@unstructuredai.io>
2023-05-17 13:48:52 +00:00
Trevor Bossert
f4f40f58e3
Add discord token so tests run (#598)
* Add discord token so tests run

* install discord deps

* Update expected results for discord test
2023-05-16 16:46:20 -07:00
Matt Robinson
b8037118c4
feat: add partition_xlsx for MSFT Excel files (#594)
* first pass on partition_xlsx

* add support for files

* add test for xlsx from filename

* added filetype metadata

* add xlsx to auto

* remove fake excel from unsupported

* version and changelog

* update docs

* update readme

* fix removed file reference

* fix some more tests

* pass in metadata filename

* add include_metadata flag
2023-05-16 19:40:40 +00:00
Trevor Bossert
830d67f653
Feat: Discord connector (#515)
* Initial commit of discord connector

based off of initial work by @tnachen with modifications

https://github.com/tnachen/unstructured/tree/tnachen/discord_connector

* Add test file

change format of imports

* working version of the connector

More work to be done to tidy it up and add any additional options

* add to test fixtures update

* fix spacing

* tests working, switching to bot testing channel

* add additional channel

add reprocess to tests

* add try clause to allow for exit on error

Update changelog and bump version

* add updated expected output filtes

* add logic to check if —discord-period is an integer

Add more to option description

* fix lint error

* Update discord reqs

* PR feedback

* add newline

* another newline

---------

Co-authored-by: Justin Bossert <packerbacker21@hotmail.com>
2023-05-16 11:46:30 -07:00
Nicolas
c62bee48ad
Update installing.rst (#590) 2023-05-16 02:08:01 +00:00
Matt Robinson
bd6a8a3a40
enhancement: add file_directory to element metadata (#585)
* enhancement: add `file_directory` to element metadata

* update msg test

* exclude file_directory

* update slack output

* added file directory tests on partition_x paths
2023-05-15 18:25:39 -04:00
Yuming Long
33cc3f8637
Fix: support hml filetype in partition as a variation of html (#586)
* quick fx to add hml filetype

* changelog and version
2023-05-15 16:35:53 -04:00
Yuming Long
5b6f11bb88
Chore(ingest): Add --partition-strategy parameter in CLI (#582)
* change strategy arg defalut to auto in partition

* passing --partition-strategy down

* add strategy="hi_res" to test (default changed)

* made an error on param name, added note
2023-05-15 19:26:53 +00:00
qued
55272eeceb
enhancement: filetype in metadata (#583)
Adds filetype to metadata. I've created a decorator that adds metadata to a list of elements. This replaces some existing boilerplate, but also adds a nice layered approach to determining the filetype. Since in some cases several partition_ functions handle a file in various formats, the partition function that first touches a file will be the last one to alter its metadata, resulting in the correct filetype metadata.

Tests are added to make sure:

* When partition is used, any content type or auto file type detection will override file-specific partition function metadata
* Both auto and file-specific partitioning gives the desired filetype metadata

Won't work with image files currently... the plumbing is there to use the image format inferred by PIL, but we need to pull in the fix from this PR to unstructured-inference .
2023-05-15 13:23:19 -05:00
Matt Robinson
99aa346186
fix: make pytesseract a function level import (#581)
* make pytesseract a function level import

* version and changelog

* small docs formatting fix
2023-05-12 17:18:51 -05:00
Matt Robinson
e052c2a9b2
docs: example of how to use unstructured with pgvector (#571)
* pgvector requirements

* first pass on pgvector notebook and sql alchemy file

* created code for loading vectors into db

* added query for embedding distance

* updates to pgvector notebook

* update function with time decay

* update pgvector notebook to use example code

* remove old create table script

* add readme for pgvector

* update example to use get_date()
2023-05-12 13:54:38 -04:00
Matt Robinson
727d366a94
enhancement: auto strategy for PDFs and images (#578)
* added functions for determining auto stratgy

* change default strategy to auto

* tests for auto strategy

* update docs

* changelog and version

* bump version

* remove ingest file in wrong location

* update jpg output

* typo fix
0.6.6
2023-05-12 17:45:08 +00:00
Matt Robinson
210e735f6f Revert "bump version for release"
This reverts commit 296959b91e425ad6b99c85c240bdd86ec098ae17.
2023-05-12 11:50:25 -04:00
Matt Robinson
296959b91e bump version for release 2023-05-12 11:33:47 -04:00
Matt Robinson
8da1ddc6ec
enhancement: add method for getting datetime; cleanup filename attribute (#575)
* added method for extracting datetime

* change filename metadata to the base filename

* fix filename metadata for msg

* changelog and bump version

* fix expected structured output

* newline back in file

* reset outpout file

* update filename output

* update test fixtures

* update fixture
2023-05-12 11:33:01 -04:00
Kevin Pan
7c07b3f690
feat: Read docx tables (#572)
* add table parsing

* import paragraph

* update changelog

* add example docx

* revert changelog formatting

* update function name for consistency

* add both text and html metadata for table

* update with metadata in docx table note

---------

Co-authored-by: kevin pan <kevin.pan@strivr.com>
2023-05-11 18:31:38 +00:00
Matt Robinson
38f7b652de
fix: add handling for non-standard rfc-2822 formats (#564)
* fix: add handling for non-standard rfc-2822 formats

* version and changelog

* linting, linting, linting
2023-05-11 14:36:25 +00:00
Yida Liu
f46eb06e2d
fix: check json and eml decode ignore error (#574) 2023-05-10 22:00:11 -07:00
John
328863375e
fix: include all metadata fields when converting to dataframe or CSV (#568)
* fix: include all metadata fields when converting to dataframe or CSV (#555)

* bump version after merge from main

---------

Co-authored-by: Matt Robinson <mrobinson@unstructured.io>
2023-05-10 13:03:33 -04:00
Yuming Long
0f91a9bfa8
Chore: Add a trace logger for NLP output (#561)
* add and config trace logger

* chore: update loggers in partition

* doc: changelog and version

* doc: update changelog

* doc: remove placeholder

* chore: bypass mypy
2023-05-10 16:16:15 +00:00
ryannikolaidis
b52638f8e3
chore: add support for SpooledTemporaryFiles (#569) 0.6.5 2023-05-09 21:39:07 -07:00
Matt Robinson
19beb24e03
docs: unstructured -> MySQL example (#557)
* added requirements for mysql

* first bit of mysql notebook

* update requirements file

* wrap with mysql example

* update readme with install instructions
2023-05-09 13:26:49 +00:00
cragwolfe
aaea6358f6
build(deps): bump pip (#558) 2023-05-08 23:08:10 -07:00
ryannikolaidis
2fc4d37454
chore: pin inference version, bump deps, and update openssl (#551) 2023-05-08 17:02:55 -07:00
Matt Robinson
3d3f3df3ec
enhancement: add "ocr_only" strategy for PDFs (#553)
* add tests for validating strategy

* refactor into determine_pdf_strategy function

* refactor pdf strategies into strategies

* remove commented out code

* remove unreachable code

* add in handling for image types

* a little more refactoring

* import ocr partioning for images

* catch warnings, partition type for valid strategies

* fallback to ocr_only from fast

* fallback logic for hi_res

* test for fallback to ocr only

* fallback logic ofr ocr_only

* more tests for fallback logic

* update doc strings

* version and changelog

* linting, linting, linting

* update docs to include notes about strategy

* fix typos

* change back patched filename
0.6.4
2023-05-08 17:21:24 +00:00
Trevor Bossert
1ac72c6ee8
Fixes issue where detectron2 would not install on OSX (#552)
* Fixes issue where detectron2 would not install on OSX

Tested on Apple silicon based MacBook Pro.  This installs tensorboard which is required on OSX and arm based cpu’s for detectron2.

* Improve Arch detection for tensorboard

* remove makefile from commands in readme

pin tensorboard version
2023-05-05 17:16:28 -07:00
Matt Robinson
0fc0571c02
fix(ci): don't skip deploy for tags (#549) 2023-05-05 09:51:41 -04:00
Matt Robinson
392cccdbf7
enhancement: add ocr_only strategy for partition_image (#540)
* spike for ocr-only strategy for images

* fix for file processing

* extra space

* add korean to ci

* added test for ocr_only strategy

* added docs for ocr_only

* changelog and version

* added test for bad strategy

* skip korean test if in docker

* bump version

* version bump

* document valid strategies

* bump version for release

---------

Co-authored-by: qued <64741807+qued@users.noreply.github.com>
0.6.3
2023-05-04 20:23:51 +00:00