<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel rdf:about="https://community.wolfram.com">
    <title>Community RSS Feed</title>
    <link>https://community.wolfram.com</link>
    <description>RSS Feed for Wolfram Community showing questions tagged with Computer Science sorted by active.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3711906" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/401838" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3581574" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/506116" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3476176" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3175724" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3398676" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3403892" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3413235" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3396485" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3363816" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3365621" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3356414" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3352838" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3347998" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3311941" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3249480" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3275361" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3256765" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3248209" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3711906">
    <title>Failure of universal approximation theorem</title>
    <link>https://community.wolfram.com/groups/-/m/t/3711906</link>
    <description>Maybe the theorem has a set of measure 0 for which it fails? I have 3 nested functions, each quadratic in its inputs. A standard multi-layer linear plus logistic NN with ADAM optimizer can&amp;#039;t seem to minimize the loss (or it gets stuck in a local minimum). I&amp;#039;ve tried varying the number of layers, and their width, but to no avail. What&amp;#039;s going on?&#xD;
&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/47d5251d-896e-4401-97eb-d9794b91e871</description>
    <dc:creator>Iuval Clejan</dc:creator>
    <dc:date>2026-05-04T19:31:25Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/401838">
    <title>Algorithm underlying MorphologicalGraph</title>
    <link>https://community.wolfram.com/groups/-/m/t/401838</link>
    <description>Hi all,&#xD;
&#xD;
As we are writing up a publication for which we used the built-in function **MorphologicalGraph**, I was wondering whether someone could tell if this function is based on a known, named algorithm so that I can also refer to the exact algorithm that lies at the basis of our findings.&#xD;
&#xD;
Thanks,&#xD;
&#xD;
Jan</description>
    <dc:creator>Jan Baetens</dc:creator>
    <dc:date>2014-12-04T12:01:47Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3581574">
    <title>Installing CUDALink on Mathematica 14.3</title>
    <link>https://community.wolfram.com/groups/-/m/t/3581574</link>
    <description>I have installed the NVIDIA CUDA Toolkit version 13.0 on my Windows 11 Pro PC. The PC is an HP Z2SFF G5 Workstation with 64 GB memory and an Intel Core i7-10700 CPU @ 2904 MHz. Windows 11 is version 10.0.26100, Build 26100.&#xD;
&#xD;
I have previously installed cupy and numba into my VS Code environment for Python development and that works just fine.&#xD;
&#xD;
I have done a fresh install of the CUDA Toolkit version 13.0 and NVIDIA driver version 581.8 on the PC.&#xD;
&#xD;
Commands like &amp;#039;CUDADeviceCount[]&amp;#039;, &amp;#039;CUDAInformation[]&amp;#039; and &amp;#039;CUDADriverVersio[]&amp;#039; all work correctly and without error.&#xD;
&#xD;
Executing the command &amp;#039;InstallCUDA[]&amp;#039;, however, gives the error &amp;#039;Failed to find CUDA libraries&amp;#039;. &#xD;
&#xD;
Here&amp;#039;s the bit of code I used for testing my installation&#xD;
&#xD;
    Needs[&amp;#034;CUDALink`&amp;#034;]&#xD;
    InstallCUDA[]&#xD;
   &#xD;
![Error Message][1]&#xD;
The problem seem to be that the libraries (*.dll) are located in the folder &#xD;
&#xD;
    C:\Brogram Files\NVIDIA GPU Toolkit\CUDA\V130\bin\x64, &#xD;
but Mathematica is looking for them in &#xD;
&#xD;
    C:\Brogram Files\NVIDIA GPU Toolkit\CUDA\V130\bin.&#xD;
The Help for InstallCUDA[] says: &#xD;
&#xD;
&amp;#034;InstallCUDA uses heuristic methods to find the CUDA toolkit on your system.&amp;#034;&#xD;
&#xD;
 and&#xD;
&#xD;
&amp;#034;InstallCUDA returns a Failure object when it can not find or load the appropriate CUDA libraries.&amp;#034;&#xD;
&#xD;
I was unsuccessful in trying to find what the heuristic actually does.  &#xD;
I tried adding the correct folder to $Path with no effect.&#xD;
I tried copying the contents of the x64 folder to the bin subfolder, but this created a raft of additional errors.&#xD;
I tried running Mathematica as both a normal user and as system administrator.&#xD;
&#xD;
I&amp;#039;m sure I&amp;#039;m overlooking some simple solution to this issue, but will appreciate guidance from others.&#xD;
&#xD;
Thanks&#xD;
Pat&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2192CUDAerrorMessagejpg.jpg&amp;amp;userId=531737</description>
    <dc:creator>Pat Lane</dc:creator>
    <dc:date>2025-11-26T01:39:04Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/506116">
    <title>Calling RESTful API with permissions??</title>
    <link>https://community.wolfram.com/groups/-/m/t/506116</link>
    <description>Hi everyone,&#xD;
&#xD;
I was just wondering if anyone knew how to call a cloud API that HAS permissions from a standalone application? I&amp;#039;ve seen some discussions about calling an API from VBA for example but in all the examples I&amp;#039;ve seen they are Public API&amp;#039;s. How do you authentic the API call with your credentials?&#xD;
&#xD;
Thanks a lot for any help!&#xD;
&#xD;
Andrew</description>
    <dc:creator>Andrew Yule</dc:creator>
    <dc:date>2015-05-28T13:11:23Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3476176">
    <title>Overflow calculating the last 10, 000 digits of (((96717311574016^16777216^4)^8^4)^7)^2</title>
    <link>https://community.wolfram.com/groups/-/m/t/3476176</link>
    <description>why is 96717311574016^8^16 the biggest number it can compute and any number larger than that overflows?  &#xD;
I was discussing the first 4000 digits of my expression (((96717311574016^16777216^4)^8^4)^7)^2 * 7^11. Because this expression is greater than 96717311574016^8^16 and it is going to overflow, can someone help me how to calculate the LAST ten thousand, or even MILLION digits of this expression. Do I calculate the mod of this expression?   &#xD;
Can I even calculate the mod if its just going to overflow?</description>
    <dc:creator>Mark Raygorodsky</dc:creator>
    <dc:date>2025-06-08T21:05:22Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3175724">
    <title>Configuring Python for ExternalEvaluate</title>
    <link>https://community.wolfram.com/groups/-/m/t/3175724</link>
    <description>I am following [this guide][1] to try to get Python working in `ExternalEvaluate`. (on Windows 11, Mathematica 13.0).  So far, I have successfully installed Python (Step 1), and the Python package manager (Step 2), and the “pyzmq” package for Python (Step 3).&#xD;
&#xD;
But I get a &amp;#034;Missing Dependencies&amp;#034; error on Step 4:&#xD;
![enter image description here][2]&#xD;
From [this post][3], I learned that this may be because the Python library path may not be in Mathematica&amp;#039;s default Path. So I tried using `SetEnvironment`, to no avail:&#xD;
![enter image description here][4]&#xD;
I then use `RegisterExternalEvaluator`, but still get MissingDependencies:&#xD;
![enter image description here][5]&#xD;
And `FindExternalEvaluators[&amp;#034;Python&amp;#034;]` still shows MissingDependencies.  Not sure what else to try. &#xD;
&#xD;
&#xD;
  [1]: https://reference.wolfram.com/language/workflow/ConfigurePythonForExternalEvaluate.html&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2024-05-13missingdependencies.png&amp;amp;userId=167076&#xD;
  [3]: https://community.wolfram.com/groups/-/m/t/1975953&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=6197Screenshot2024-05-13setEnvironment.png&amp;amp;userId=167076&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2024-05-13register.png&amp;amp;userId=167076</description>
    <dc:creator>Bryan Lettner</dc:creator>
    <dc:date>2024-05-13T23:50:08Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3398676">
    <title>Question About Counting Spots on a Leaf in Mathematica</title>
    <link>https://community.wolfram.com/groups/-/m/t/3398676</link>
    <description>Hi Giulio Alessandrini,&#xD;
&#xD;
Thank you for your guidance on this code. I tested a few leaf samples, and one of them is encountering a significant error during loading. I would appreciate it if you could provide some guidance on these errors.</description>
    <dc:creator>Flora Vosoughi</dc:creator>
    <dc:date>2025-02-21T14:55:40Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3403892">
    <title>Overflow while computing 10^16 digit</title>
    <link>https://community.wolfram.com/groups/-/m/t/3403892</link>
    <description>I have joined you guys because the biggest number Wolfram Mathematica computes is 10^16 digit number, and go bigger than that and it overflows!  &#xD;
Is there any way to compute the first 4, 000 digits of my expression 96717311574016^(8^36 * 14) * 5764801 * 7^3, since that is about 10^20 bigger than the biggest number Mathematica can compute?   &#xD;
         I know it isn&amp;#039;t possible to see the whole number; it will take me at least BILLIONS OF YEARS to scan over that number! I just need to know how to get the first 4, 000 digits of any number bigger than 8^16, like my expression above. It&amp;#039;s like scientific notation with a long number after the decimal.  Do I use logarithms?   &#xD;
What&amp;#039;s the largest ever number Wolfram alpha can ever compute? This site says it computes answers to arbitrary precision. So does arbitrary in this context mean there&amp;#039;s no limit to how big it can go?   &#xD;
Most importantly, how come 8^16 is the biggest number Mathematica can compute and any bigger number overflows?</description>
    <dc:creator>Mark Raygorodsky</dc:creator>
    <dc:date>2025-03-03T20:34:53Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3413235">
    <title>decimal approximations of large numbers</title>
    <link>https://community.wolfram.com/groups/-/m/t/3413235</link>
    <description>I apologize if my question seems redundant. There are numbers so big it exceeds the space we have on this earth. I have read up an article on it and it stated that our earth is estimated to only 10^50 atoms wide.  &#xD;
I noticed that starting at 96717311574016^8^16 Wolfram alpha no longer computes decimal approximations; it only gives me a power of ten representation. A power of ten representation isn&amp;#039;t useful in knowing the numbers digits to a given precision. Has it have to do the fact that we only occupy so much space on this planet?  &#xD;
Thanks a lot for the help I may get!  &#xD;
This may be my second to last post.</description>
    <dc:creator>Mark Raygorodsky</dc:creator>
    <dc:date>2025-03-10T00:57:50Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3396485">
    <title>Seeking Help to Improve Image Processing Code in Mathematica.</title>
    <link>https://community.wolfram.com/groups/-/m/t/3396485</link>
    <description>Hi everyone, I’m working on an image processing project in Mathematica to count spots on tree leaves, and I’ve written a code, but it doesn’t accurately detect the number of spots. Could anyone help or provide guidance? &#xD;
Thank you so much for your time and valuable input!</description>
    <dc:creator>Flora Vosoughi</dc:creator>
    <dc:date>2025-02-18T18:09:50Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3363816">
    <title>Speeding up the fitting of a model with 23 parameters using NonLinearModelfit</title>
    <link>https://community.wolfram.com/groups/-/m/t/3363816</link>
    <description>I have an experimental dataset. Data points are of the type {w,y} where w is the frequency and y is experimental absorbance. I want to fit this data with a spectroscopic line profile using NonLinearModelfit  function in Mathematica. Size of data is about 500 points and the number of parameters to be fitted around 23-28. It is taking lot of time around 7-8 hours. I cannot divide my dataset and compute parallelly because in that case there will be no consistency of the fitted parameters across the divided datasets. Then how to faster the process? Any suggestions?</description>
    <dc:creator>Rajesh Chell</dc:creator>
    <dc:date>2025-01-24T14:17:01Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3365621">
    <title>How mathematica interfacing with PYNQ-Z2 board</title>
    <link>https://community.wolfram.com/groups/-/m/t/3365621</link>
    <description>To run the Mathematica runtime directly on the PYNQ board, you’ll have to cross-compile Wolfram libraries for ARM.&#xD;
&#xD;
Wolfram Mathematica does not natively provide ARM-compatible libraries (libWolframRTL.so) for ARM platforms such as the PYNQ board. The libraries provided by Wolfram are typically built for x86-64 Linux systems, which causes the architecture mismatch when you try to use the ARM cross-compiler (arm-linux-gnueabihf-gcc).&#xD;
&#xD;
In this, ARM-compatible libraries from Wolfram are required. Or please provide a custom solution or suggest alternatives.</description>
    <dc:creator>Vijaya Babu Panthagani</dc:creator>
    <dc:date>2025-01-28T13:59:01Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3356414">
    <title>Help out the oldest computation in history</title>
    <link>https://community.wolfram.com/groups/-/m/t/3356414</link>
    <description>##Background:&#xD;
&#xD;
The Cunningham project may be the longest ongoing computational project in history. See https://homes.cerias.purdue.edu/~ssw/cun/. As of this writing there are 21 numbers as yet unfactored from the 1987 published version of the book. These are all numbers of the form 2^n+1 for n &amp;lt; 1200 and 2^(2n+1) +/- 2^(n+1) + 1 for n &amp;lt; 600&#xD;
&#xD;
A number of years ago a big push was made to finish all Mersenne numbers (2^n-1) for n &amp;lt; 1200.&#xD;
&#xD;
It would be nice to finish this last small set of composites. They were added to the tables in the early 1960&amp;#039;s by John Selfridge and D.H. Lehmer, so have been waiting for over 60 years to get done. Attempts to factor these numbers have been made since the time of Fermat, so they have strong historical interest.&#xD;
&#xD;
##Current status and request:&#xD;
&#xD;
A BOINC project (https://escatter11.fullerton.edu/nfs/) is currently being run that uses the Number Field Sieve to factor these numbers, but it is &amp;#034;running out of steam&amp;#034;.&#xD;
&#xD;
While this sort of project is out of scope in terms of not using Wolfram Language or related, it nonetheless might appeal to some participants in this forum, especially those with amateur (or professional) interests in computational number theory. And joining the project does not presume or require factoring expertise. It is a generic BOINC project, similar to SETI at Home, Protein Folding at Home, etc. That is to say, it&amp;#039;s a distributed crowd-sourced effort.&#xD;
&#xD;
This is a request for people to join the project to help finish these composites. This project pushes the state of the art in factoring algorithms.</description>
    <dc:creator>Robert Silverman</dc:creator>
    <dc:date>2025-01-13T16:56:42Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3352838">
    <title>Customizing wolfram API calls</title>
    <link>https://community.wolfram.com/groups/-/m/t/3352838</link>
    <description>After creating a package in wolfram, i would like the call the package directly from the library without from host to executed in C. How to link ( wstp) that package in C libraries &#xD;
How to frane the question  and give the solution &#xD;
&#xD;
&#xD;
&#xD;
How can I directly link a Wolfram Mathematica package (.m or .wl) to a C program using Wolfram Symbolic Transfer Protocol (WSTP), such that the package can be loaded and executed within the C environment without explicitly requiring the host interface? What are the steps to integrate the package into a C library and use it seamlessly?&#xD;
&#xD;
Solution&#xD;
1. Package Preparation&#xD;
Ensure the Mathematica package is well-structured and contains the functions you want to call. For example:&#xD;
&#xD;
(* File: arithmetic.wl *)&#xD;
BeginPackage[&amp;#034;Arithmetic`&amp;#034;]&#xD;
Add::usage = &amp;#034;Add[x, y] adds two numbers.&amp;#034;&#xD;
Subtract::usage = &amp;#034;Subtract[x, y] subtracts the second number from the first.&amp;#034;&#xD;
Begin[&amp;#034;`Private`&amp;#034;]&#xD;
Add[x_, y_] := x + y&#xD;
Subtract[x_, y_] := x - y&#xD;
End[]&#xD;
EndPackage[]&#xD;
Save this file as arithmetic.wl or arithmetic.m.&#xD;
&#xD;
2. Write the Wolfram Script for WSTP&#xD;
Create a Wolfram script (.wls) to expose the package&amp;#039;s functions over WSTP.&#xD;
&#xD;
(* File: ArithmeticServer.wls *)&#xD;
Needs[&amp;#034;Arithmetic`&amp;#034;]&#xD;
&#xD;
Install[LinkCreate[&amp;#034;ArithmeticLink&amp;#034;]];&#xD;
&#xD;
Add[x_, y_] := Arithmetic`Add[x, y];&#xD;
Subtract[x_, y_] := Arithmetic`Subtract[x, y];&#xD;
&#xD;
While[LinkReadyQ[&amp;#034;ArithmeticLink&amp;#034;],&#xD;
  LinkRead[&amp;#034;ArithmeticLink&amp;#034;];&#xD;
  (* Process requests here *)&#xD;
]&#xD;
&#xD;
LinkClose[&amp;#034;ArithmeticLink&amp;#034;];&#xD;
Run this script on the Mathematica kernel to expose the functions through WSTP.&#xD;
&#xD;
3. Generate the WSTP Template&#xD;
Use the mprep tool to generate a C header file for the interface.&#xD;
&#xD;
Create a .tm file:&#xD;
&#xD;
:Begin:&#xD;
:Function: Add&#xD;
:Pattern: Add[x_Integer, y_Integer]&#xD;
:Arguments: { x, y }&#xD;
:ArgumentTypes: { Integer, Integer }&#xD;
:ReturnType: Integer&#xD;
:End:&#xD;
&#xD;
:Begin:&#xD;
:Function: Subtract&#xD;
:Pattern: Subtract[x_Integer, y_Integer]&#xD;
:Arguments: { x, y }&#xD;
:ArgumentTypes: { Integer, Integer }&#xD;
:ReturnType: Integer&#xD;
:End:&#xD;
Run mprep:&#xD;
&#xD;
mprep Arithmetic.tm -o Arithmetic.c&#xD;
4. Write the C Program&#xD;
Link your Mathematica package with the generated C code using the WSTP functions.&#xD;
&#xD;
#include &amp;lt;wstp.h&amp;gt;&#xD;
#include &amp;lt;stdio.h&amp;gt;&#xD;
&#xD;
int main() {&#xD;
    WSLINK link;&#xD;
    int errorCode;&#xD;
&#xD;
    // Initialize WSTP&#xD;
    if (!WSInitialize(NULL)) {&#xD;
        printf(&amp;#034;Failed to initialize WSTP\n&amp;#034;);&#xD;
        return 1;&#xD;
    }&#xD;
&#xD;
    // Open the link&#xD;
    link = WSOpenString(NULL, &amp;#034;-linkname &amp;#039;ArithmeticLink&amp;#039;&amp;#034;, &amp;amp;errorCode);&#xD;
    if (link == NULL || errorCode != WSEOK) {&#xD;
        printf(&amp;#034;Failed to open WSTP link: %d\n&amp;#034;, errorCode);&#xD;
        return 1;&#xD;
    }&#xD;
&#xD;
    // Example: Call the Add function&#xD;
    WSPutFunction(link, &amp;#034;Add&amp;#034;, 2);&#xD;
    WSPutInteger(link, 5);&#xD;
    WSPutInteger(link, 3);&#xD;
&#xD;
    WSEndPacket(link);&#xD;
    WSTestHead(link, &amp;#034;Integer&amp;#034;, &amp;amp;errorCode);&#xD;
&#xD;
    int result;&#xD;
    WSGetInteger(link, &amp;amp;result);&#xD;
    printf(&amp;#034;Result of Add: %d\n&amp;#034;, result);&#xD;
&#xD;
    // Close the link&#xD;
    WSClose(link);&#xD;
    WSDeinitialize();&#xD;
    return 0;&#xD;
}&#xD;
5. Compile and Run the Program&#xD;
Compile using gcc (or an appropriate compiler):&#xD;
&#xD;
gcc -o ArithmeticClient Arithmetic.c -lWSTP&#xD;
Run the Wolfram script (ArithmeticServer.wls) to initialize the WSTP link.&#xD;
&#xD;
Run the compiled C program:&#xD;
&#xD;
./ArithmeticClient&#xD;
&#xD;
Iam getting WSTP linking problem .Could anyone guide me , how to link wstp with C code</description>
    <dc:creator>Vijaya Babu Panthagani</dc:creator>
    <dc:date>2025-01-08T04:04:00Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3347998">
    <title>Problem with running script using import</title>
    <link>https://community.wolfram.com/groups/-/m/t/3347998</link>
    <description>If I create a file through a program and save the data in a folder on the desktop I can import the data to be used in another program but if I turn off mathematica and reopen the program that imports the data I can no longer import it and if I can import the data, the script doesn&amp;#039;t run perfectly, which doesn&amp;#039;t happen when I run the program when I generate the folder data without turning off mathematica</description>
    <dc:creator>Luis Felipe Massena Misiec</dc:creator>
    <dc:date>2025-01-01T14:57:45Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3311941">
    <title>Increasing efficiency of Monte Carlo simulation of stochastic differential equation</title>
    <link>https://community.wolfram.com/groups/-/m/t/3311941</link>
    <description>Thanks in advance for you interest,&#xD;
&#xD;
I&amp;#039;m seeking advice if there are ways to speed up the computation of my simulation, without reducing accuracy.&#xD;
&#xD;
I&amp;#039;ve been producing a simulation of an SDE of the Ornstein-Uhlenbeck process on a regular simplex. In particular, I look at a simplex with $m$ number of spatial dimensions, with the stochastic process $x$ starting at a uniform random location and evolving form there a tendency mean reversion. Further, the point of reversion changes halfway through the simulation. &#xD;
&#xD;
Because of the unusual domain the best way to get at this is through simulating many replicates and averaging them together (in fact, I&amp;#039;m interested in a function $R(x)$ of the process). &#xD;
&#xD;
However, I&amp;#039;ve had difficulty getting the standard error of the simulation low enough to for my purposes (finding min and max values over input parameter combinations). The levers I&amp;#039;ve been playing with are (1) number of replicates, (2) the time increment of simulation, (3) the SDE simulation method (e.g. Milstein). &#xD;
&#xD;
What I&amp;#039;m seeking is advice on is if there are ways I can change my code to induce quicker computation, without sacrificing accuracy (e.g., reducing number of replicates makes things quicker but less accurate). &#xD;
&#xD;
Thanks again for any input:&#xD;
&#xD;
    (** Computes \[CapitalEpsilon][R(X)] **)&#xD;
    &#xD;
    (* \[Eta],\[Kappa],m,q,T are input parameters *)&#xD;
    (* \[Eta]: upper limit of a simplex side *)&#xD;
    (* \[Kappa]: rate of mean reversion *)&#xD;
    (* m: number of spatial dimensions *)&#xD;
    (* T: time limit *) &#xD;
    &#xD;
    (* \[CapitalDelta]t: the time increment of the SDE simulation *)&#xD;
    (* reps: number of replicate simulations *) &#xD;
    &#xD;
    \[ScriptCapitalE]R[\[Eta]_, \[Kappa]_, m_, q_, &#xD;
      T_, \[CapitalDelta]t_ : 0.01, reps_ : 10^4] :=&#xD;
     Block[{xopt0, xopt1, F, R, x0, xs, xts, B, M, \[Sigma], \[Mu], proc, &#xD;
       RTs, t, \[Mu]0, \[Mu]1},&#xD;
      &#xD;
      (** produces random initial condition for each replicate **)&#xD;
      x0 = Map[\[Eta]*Join[#, {1 - Total[#]}] &amp;amp;, &#xD;
        RandomVariate[DirichletDistribution[ConstantArray[1, {m}]], reps]];&#xD;
      &#xD;
      (** produces label of each spatial variable: X_1,X_2,...,X_m *)&#xD;
      xs = Table[Symbol[&amp;#034;x&amp;#034; &amp;lt;&amp;gt; ToString[i]], {i, m}];&#xD;
      xts = Map[(#[t] &amp;amp;), xs];&#xD;
      &#xD;
      &#xD;
      (** produces the deterministic dynamics and noise correlation \&#xD;
    matrices  **)&#xD;
      (* mean reversion point is called xopt - &#xD;
      there are two because dynamics change halfway *)&#xD;
      xopt0 = ConstantArray[\[Eta]/m, {m}]; &#xD;
      xopt1 = &#xD;
       Clip[If[q &amp;lt; 1.00, &#xD;
         Prepend[ConstantArray[\[Eta]/m - &#xD;
            1/m Log[(m - 1) q/(1 - q)], {m - 1}], \[Eta]/&#xD;
           m + (m - 1)/m Log[(m - 1) q/(1 - q)]], &#xD;
         Prepend[ConstantArray[0, {m - 1}], \[Eta]]], {0, \[Eta]}]; &#xD;
      &#xD;
      (* matrices constrain movement to simplex domain *)&#xD;
      B[x_] := DiagonalMatrix[Map[Boole[# &amp;gt; 0] &amp;amp;, x]];&#xD;
      M[x_] := Total[Map[Boole[# &amp;gt; 0] &amp;amp;, x]];&#xD;
      &#xD;
      (* \[Sigma] is the correlation matrix, \[Mu] the deterministic \&#xD;
    transition matrix *)&#xD;
      \[Sigma] = &#xD;
       B[xts] . (IdentityMatrix[m] - &#xD;
          1/M[xts]*ConstantArray[1, {m, m}] . B[xts]);&#xD;
      &#xD;
      \[Mu][xoptin_] := \[Sigma] . (\[Kappa] (xoptin - xts));&#xD;
      &#xD;
      (* two deterministic matrices because dynamics change halfway *)&#xD;
      \[Mu]0 = \[Mu][xopt0];&#xD;
      \[Mu]1 = \[Mu][xopt1];&#xD;
      &#xD;
      (* provides function which random vector process X from SDE is fed \&#xD;
    into *)&#xD;
      F[x_] := 1 - E^-x;&#xD;
           R[xvec_] := &#xD;
       q*F[xvec[[1]]] + (1 - q)/(m - 1)*(Sum[F[xvec[[i]]], {i, 2, m}]);&#xD;
      &#xD;
      (** simulation of replicate trajectories **)&#xD;
      (* halfway dynamics change *)&#xD;
      (* &amp;#039;proc&amp;#039; takes random initial condition and produces a trajectory *)&#xD;
      (* trajectory is fed into &amp;#039;R&amp;#039; *)&#xD;
      proc[x0in_] :=&#xD;
       Block[{X0, X1},&#xD;
        X0 = &#xD;
         RandomFunction[&#xD;
          ItoProcess[{\[Mu]0, \[Sigma]}, {xs, x0in}, {t, 0.}], {0., T/&#xD;
           2, \[CapitalDelta]t}, Method -&amp;gt; &amp;#034;Milstein&amp;#034;];&#xD;
        X1 = &#xD;
         RandomFunction[&#xD;
          ItoProcess[{\[Mu]1, \[Sigma]}, {xs, X0[&amp;#034;LastValues&amp;#034;][[1]]}, {t, &#xD;
            0.}], {T/2, T, \[CapitalDelta]t}, Method -&amp;gt; &amp;#034;Milstein&amp;#034;];&#xD;
        TimeSeriesMap[R, TimeSeriesInsert[X0, X1]][&amp;#034;ValueList&amp;#034;]&#xD;
        &#xD;
        ];&#xD;
      &#xD;
      (* replicates are paralellized over random initial condition values \&#xD;
    *)RTs = Parallelize@Table[proc[x0[[i]]], {i, reps}];&#xD;
      &#xD;
      (* expected value over time and space is result *)&#xD;
      Mean[Flatten[RTs]]&#xD;
      &#xD;
      ]&#xD;
    &#xD;
    (* on the order of 3 minutes *)&#xD;
    AbsoluteTiming[\[ScriptCapitalE]R[1.00, .50, 3, 1.00, 1.00]]</description>
    <dc:creator>Cameron Turner</dc:creator>
    <dc:date>2024-10-30T17:42:19Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3249480">
    <title>Unit conversions that used to work on WolframAlpha are broken. How do I do it now, or is it a bug?</title>
    <link>https://community.wolfram.com/groups/-/m/t/3249480</link>
    <description>I make a lot of queries that look something like...&#xD;
&#xD;
&amp;gt; 1.92 TB / 128 KiB&#xD;
&#xD;
The expected result is a ratio, telling me how many 128 KiB units of data can fit into 1.92TB of storage. In this case, I expect an answer of about 14.6 million.&#xD;
&#xD;
Up until recently this type of query has worked flawlessly, but when I try it today, it&amp;#039;s not working.&#xD;
Does anybody know what&amp;#039;s going on? Is there some other way I&amp;#039;m supposed to format this kind of query now, or is this a bug?</description>
    <dc:creator>Matthew McMullan</dc:creator>
    <dc:date>2024-08-16T15:48:12Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3275361">
    <title>Mathematica code to extract tabulated data after conversion from pdf to text</title>
    <link>https://community.wolfram.com/groups/-/m/t/3275361</link>
    <description>I&amp;#039;ve written the following code to extract the data I need from invoices which are in pdf format but can vary in terms of layout and terminology:&#xD;
&#xD;
    (*Step 1:Prepare Training Data*)&#xD;
    trainingDataItemDesc = {&#xD;
      &amp;#034;Description&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;DESCRIPTION&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Product Name&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Product Details&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Products&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
       &amp;#034;Product&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Details&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Desc&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;ITEM&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Product Description&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Item Description&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;ITEMS&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Description of Goods Sold&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Part Number/Description&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;PRODUCT NAME&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;PRODUCT DETAILS&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;PRODUCTS&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
       &amp;#034;PRODUCT&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;DETAILS&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;DESC&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;PRODUCT DESCRIPTION&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
       &amp;#034;ITEM DESCRIPTION&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;DESCRIPTION OF GOODS SOLD&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;PART NUMBER/DESCRIPTION&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;description&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;product name&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
       &amp;#034;product details&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;products&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;product&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;details&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;desc&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;item&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;product description&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
       &amp;#034;item description&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;items&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;description of goods sold&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;part number/description&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Description:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;DESCRIPTION:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Product Name:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Product Details:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Products:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Product:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Details:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Desc:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;ITEM:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Product Description:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Item Description:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;ITEMS:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
       &amp;#034;Description of Goods Sold:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Part Number/Description:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
      &amp;#034;Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;TOTAL REMITTANCE:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;[GBP] TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Grand Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Invoice total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Total VAT&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Total Paid&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Amount Due:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;AMOUNT (USD)&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Order Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Invoice Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Gross Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Net Price (per unit)&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Total paid&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Invoice Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;TOTAL INC. VAT:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Total Amount Due&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;GRAND TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;INVOICE TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;TOTAL VAT&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;TOTAL PAID&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;AMOUNT DUE:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;ORDER TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;INVOICE TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;GROSS TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;NET PRICE (PER UNIT)&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;TOTAL AMOUNT DUE&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;total remittance:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;[gbp] total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;grand total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;invoice total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;total vat&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;total paid&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;amount due:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;amount (usd)&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;order total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;invoice total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;gross total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;net price (per unit)&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;total inc. vat:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;total amount due&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;[GBP] TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Invoice total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Total VAT:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Total Paid:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;AMOUNT (USD):&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Order Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Gross Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Net Price (per unit):&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Total paid:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Total Amount Due:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;}; trainingDataSubtot = {&#xD;
      &amp;#034;Subtotal&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Nett Total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;COMPONENT TOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Sub-Total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Sub Total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Subtotal:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Total goods ex VAT&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Sub-Total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Net value of goods&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Total Net Amount&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Net Total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Sub-total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Goods Value&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Products&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;SUB-TOTAL:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Net Amount&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Nett Total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Total Nett Goods&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Invoice Total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;SUBTOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Net total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;NETT TOTAL:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;SUB TOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;SUBTOTAL:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;TOTAL GOODS EX VAT&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;SUB-TOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;NET VALUE OF GOODS&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;TOTAL NET AMOUNT&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;NET TOTAL:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;GOODS VALUE&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;PRODUCTS&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;NET AMOUNT&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;NETT TOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;TOTAL NETT GOODS&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;INVOICE TOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;NET TOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;subtotal&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;nett total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;component total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;sub-total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;sub total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;subtotal:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;total goods ex vat&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;sub-total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;net value of goods&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;total net amount&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;net total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;goods value&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;products&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;net amount&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;nett total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;total nett goods&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;invoice total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;net total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;COMPONENT TOTAL:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Sub Total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Total goods ex VAT:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Net value of goods:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Total Net Amount:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Sub-total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Goods Value:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Products:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Net Amount:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Total Nett Goods:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
      &amp;#034;Invoice Total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Net total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
      &amp;#034;Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;TOTAL REMITTANCE:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;[GBP] TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Grand Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Invoice total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Total VAT&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Total Paid&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Amount Due:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;AMOUNT (USD)&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Order Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Invoice Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Gross Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Net Price (per unit)&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Total paid&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Invoice Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;TOTAL INC. VAT:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Total Amount Due&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;GRAND TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;INVOICE TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;TOTAL VAT&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;TOTAL PAID&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;AMOUNT DUE:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;ORDER TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;INVOICE TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;GROSS TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;NET PRICE (PER UNIT)&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;TOTAL AMOUNT DUE&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;total remittance:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;[gbp] total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;grand total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;invoice total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;total vat&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;total paid&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;amount due:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;amount (usd)&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;order total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;invoice total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;gross total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;net price (per unit)&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;total inc. vat:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;total amount due&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;[GBP] TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Invoice total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Total VAT:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Total Paid:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;AMOUNT (USD):&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Order Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Gross Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Net Price (per unit):&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
      &amp;#034;Total paid:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Total Amount Due:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;};&#xD;
    trainingDataVAT = {&#xD;
       &amp;#034;Tax&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;VAT 20.0 - 20%:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;TOTAL TAX&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;VAT (20%):&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Tax:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;VAT @ 20.00%&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;VAT (20%)&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Total Vat:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;20 % VAT&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Total VAT&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;VAT:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;VAT&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;VAT Value&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Total Tax paid&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Total VAT Amount&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;VAT 20%:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;VAT Amount&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;VAT Total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Invoice Total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
        &amp;#034;VAT TOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;V.A.T&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;TAX&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;TAX:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;TOTAL VAT:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;TOTAL VAT&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;VAT VALUE&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;TOTAL TAX PAID&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;TOTAL VAT AMOUNT&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;VAT AMOUNT&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;INVOICE TOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;tax&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;vat 20.0 - 20%:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;total tax&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;vat (20%):&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;tax:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;vat @ 20.00%&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;vat (20%)&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;total vat:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;20 % vat&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;total vat&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;vat:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;vat&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;vat value&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;total tax paid&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;total vat amount&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;vat 20%:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;vat amount&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;vat total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;invoice total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
        &amp;#034;v.a.t&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;TOTAL TAX:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;VAT @ 20.00%:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;20 % VAT:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
        &amp;#034;Total VAT:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;VAT Value:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Total Tax paid:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Total VAT Amount:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;VAT Amount:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;VAT Total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Invoice Total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;VAT TOTAL:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;V.A.T:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Subtotal&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Nett Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;COMPONENT TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Sub-Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Sub Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Subtotal:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Total goods ex VAT&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Sub-Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Net value of goods&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Total Net Amount&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Net Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Sub-total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Goods Value&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Products&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;SUB-TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Net Amount&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Nett Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Total Nett Goods&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Invoice Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;SUBTOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Net total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;NETT TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;SUB TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;SUBTOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;TOTAL GOODS EX VAT&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;SUB-TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;NET VALUE OF GOODS&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;TOTAL NET AMOUNT&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;NET TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;GOODS VALUE&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;PRODUCTS&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;NET AMOUNT&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;NETT TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;TOTAL NETT GOODS&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;INVOICE TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;NET TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;subtotal&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;nett total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;component total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;sub-total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;sub total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;subtotal:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;total goods ex vat&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;sub-total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;net value of goods&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;total net amount&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;net total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;goods value&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;products&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;net amount&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;nett total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;total nett goods&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;invoice total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;net total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;COMPONENT TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Sub Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Total goods ex VAT:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Net value of goods:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Total Net Amount:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Sub-total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Goods Value:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Products:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Net Amount:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Total Nett Goods:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;,&#xD;
        &amp;#034;Invoice Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Net total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;};&#xD;
    trainingDataTotal = {&#xD;
       &amp;#034;Total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;TOTAL REMITTANCE:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
        &amp;#034;[GBP] TOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Grand Total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Invoice total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Total VAT&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
        &amp;#034;Total Paid&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Amount Due:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
        &amp;#034;AMOUNT (USD)&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Order Total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Invoice Total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Gross Total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Net Price (per unit)&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;TOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Total paid&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Invoice Total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;TOTAL INC. VAT:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Total Amount Due&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;TOTAL:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
        &amp;#034;GRAND TOTAL:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;INVOICE TOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;TOTAL VAT&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
        &amp;#034;TOTAL PAID&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;AMOUNT DUE:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
        &amp;#034;ORDER TOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;INVOICE TOTAL:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;GROSS TOTAL&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;NET PRICE (PER UNIT)&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;TOTAL AMOUNT DUE&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;total remittance:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;[gbp] total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;grand total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;invoice total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;total vat&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
        &amp;#034;total paid&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;amount due:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;,&#xD;
        &amp;#034;amount (usd)&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;order total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;invoice total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;gross total&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;net price (per unit)&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;total inc. vat:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;total amount due&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;[GBP] TOTAL:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Invoice total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Total VAT:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Total Paid:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;AMOUNT (USD):&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Order Total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Gross Total:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Net Price (per unit):&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Total paid:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &#xD;
       &amp;#034;Total Amount Due:&amp;#034; -&amp;gt; &amp;#034;SimilarString&amp;#034;, &amp;#034;Subtotal&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;,&#xD;
        &amp;#034;Nett Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;COMPONENT TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Sub-Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Sub Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Subtotal:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Total goods ex VAT&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Sub-Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Net value of goods&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Total Net Amount&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Net Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Sub-total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Goods Value&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Products&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;SUB-TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Net Amount&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Nett Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Total Nett Goods&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Invoice Total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;SUBTOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Net total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;NETT TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;SUB TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;SUBTOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;TOTAL GOODS EX VAT&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;SUB-TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;NET VALUE OF GOODS&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;TOTAL NET AMOUNT&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;NET TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;GOODS VALUE&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;PRODUCTS&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;NET AMOUNT&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;NETT TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;TOTAL NETT GOODS&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;INVOICE TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;NET TOTAL&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;subtotal&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;nett total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;component total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;sub-total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;sub total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;subtotal:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;total goods ex vat&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;sub-total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;net value of goods&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;total net amount&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;net total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;goods value&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;products&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;net amount&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;nett total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;total nett goods&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;invoice total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;net total&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;COMPONENT TOTAL:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Sub Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Total goods ex VAT:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Net value of goods:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Total Net Amount:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Sub-total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Goods Value:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Products:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &#xD;
       &amp;#034;Net Amount:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Total Nett Goods:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;,&#xD;
        &amp;#034;Invoice Total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;, &amp;#034;Net total:&amp;#034; -&amp;gt; &amp;#034;NotSimilar&amp;#034;};&#xD;
    &#xD;
    (*Step 2:Train a Machine Learning Classifier*)&#xD;
    modelItemDesc = Classify[trainingDataItemDesc];&#xD;
    modelSubtot = Classify[trainingDataSubtot];&#xD;
    modelShip = Classify[trainingDataShip];&#xD;
    modelVAT = Classify[trainingDataVAT];&#xD;
    modelTotal = Classify[trainingDataTotal];&#xD;
    (*testPhrase=&amp;#034;Another Random Example&amp;#034;;&#xD;
    Print[&amp;#034;Test phrase classification: &amp;#034;,modelSubtot[testPhrase]];*)&#xD;
    &#xD;
    (*Step 1:Set Up the Word COM Interface*)&#xD;
    extractTextFromPDFUsingPDFtoText[pdfPath_String] := &#xD;
     Module[{outputPath, result}, &#xD;
      outputPath = &#xD;
       FileNameJoin[{DirectoryName[pdfPath], &#xD;
         FileBaseName[pdfPath] &amp;lt;&amp;gt; &amp;#034;.txt&amp;#034;}];&#xD;
      RunProcess[{&amp;#034;C:\\Poppler\\Library\\bin\\pdftotext.exe&amp;#034;, &amp;#034;-layout&amp;#034;, &#xD;
        pdfPath, outputPath}];&#xD;
      result = Import[outputPath, &amp;#034;Text&amp;#034;];&#xD;
      If[result === &amp;#034;&amp;#034;, extractTextWithOCR[pdfPath], result]]&#xD;
    &#xD;
    (*Step 2:Determine If OCR Is Required*)&#xD;
    requiresOCR[text_String] := &#xD;
     StringLength[text] &amp;lt; 50 || &#xD;
      StringMatchQ[text, RegularExpression[&amp;#034;[^a-zA-Z0-9]+&amp;#034;], &#xD;
       IgnoreCase -&amp;gt; True]&#xD;
    &#xD;
    (*Step 3:OCR Extraction Function*)&#xD;
    extractTextWithOCR[filename_String] := Module[{pages, ocrText},&#xD;
      (*Try to import the PDF as individual images*)&#xD;
      pages = Import[filename, {&amp;#034;PDF&amp;#034;, &amp;#034;Pages&amp;#034;}];&#xD;
      (*If import fails,return a failure message*)&#xD;
      If[pages === $Failed, Return[&amp;#034;$Failed&amp;#034;]];&#xD;
      (*Apply OCR to each page*)ocrText = TextRecognize /@ pages;&#xD;
      (*Combine the recognized text from all pages*)StringJoin[ocrText]]&#xD;
    &#xD;
    (*Step 4:Combined Text Extraction Function*)&#xD;
    extractTextFromPDF[filename_String] := &#xD;
     Module[{text},(*First,try to extract text using Microsoft Word*)&#xD;
      Print[filename];&#xD;
      text = Quiet[Check[extractTextFromPDFUsingPDFtoText[filename], &amp;#034;&amp;#034;]];&#xD;
      &#xD;
      (*If the extracted text is empty or looks like gibberish,apply OCR*)&#xD;
    &#xD;
      &#xD;
      If[requiresOCR[text], Print[&amp;#034;Requires OCR&amp;#034;];&#xD;
       text = extractTextWithOCR[filename]];&#xD;
      text]&#xD;
    &#xD;
    (*Step 5:Search through all subfolders in a folder and extract \&#xD;
    all.pdf filenames*)&#xD;
    getAllPDFs[folder_String] := FileNames[&amp;#034;*.pdf&amp;#034;, folder, Infinity];&#xD;
    &#xD;
    (*Specify the training and main folders where the PDFs are located*)&#xD;
    mainFolder = &#xD;
      &amp;#034;Z:\\Shared\\03 - Operations\\06 - Supply Chain\\Invoice Data \&#xD;
    Extraction\\Test&amp;#034;;&#xD;
    &#xD;
    Print[&amp;#034;Getting a list of all PDF files in the folder and its \&#xD;
    subfolders...&amp;#034;];&#xD;
    (*Get a list of all PDF files in the folder and its subfolders*)&#xD;
    pdfFiles = getAllPDFs[mainFolder];&#xD;
    &#xD;
    (*Step 5:Initialize a list to store the first entries in \&#xD;
    extractedNumbersSubtot for each file*)&#xD;
    firstEntriesItemDesc = {};&#xD;
    firstEntriesSubtot = {};&#xD;
    firstEntriesShip = {};&#xD;
    firstEntriesVAT = {};&#xD;
    firstEntriesTotal = {};&#xD;
    &#xD;
    (*Step 6:Process each file in the folder*)&#xD;
    Do[&#xD;
      &#xD;
      (*Load the file content*)&#xD;
      invoiceText = extractTextFromPDF[pdfFiles[[i]]];&#xD;
      &#xD;
      (*Step 4:&#xD;
      Find positionsSubtot of phrases in the file content that match \&#xD;
    similar strings*)&#xD;
      allPositionsItemDesc = {};&#xD;
      allPositionsSubtot = {};&#xD;
      allPositionsShip = {};&#xD;
      allPositionsVAT = {};&#xD;
      allPositionsTotal = {};&#xD;
      &#xD;
      Do[&#xD;
       (*Find positionsItemDesc of the current phrase in the file content*)&#xD;
    &#xD;
       &#xD;
       positionsItemDesc = StringPosition[invoiceText, phrase];&#xD;
       &#xD;
       (*Classify the phrase if it&amp;#039;s found in the text*)&#xD;
       If[Length[positionsItemDesc] &amp;gt; 0 &amp;amp;&amp;amp; &#xD;
         modelItemDesc[phrase] === &amp;#034;SimilarString&amp;#034;,&#xD;
        (*Add all positionsItemDesc of this phrase to the list*)&#xD;
        allPositionsItemDesc = &#xD;
         Join[allPositionsItemDesc, positionsItemDesc]&#xD;
        ],&#xD;
       {phrase, Keys[trainingDataItemDesc]}&#xD;
       ];&#xD;
      Print[allPositionsItemDesc];&#xD;
      Do[&#xD;
       (*Find positionsSubtot of the current phrase in the file content*)&#xD;
    &#xD;
       &#xD;
       positionsSubtot = StringPosition[invoiceText, phrase];&#xD;
       &#xD;
       (*Classify the phrase if it&amp;#039;s found in the text*)&#xD;
       If[Length[positionsSubtot] &amp;gt; 0 &amp;amp;&amp;amp; &#xD;
         modelSubtot[phrase] === &amp;#034;SimilarString&amp;#034;,&#xD;
        (*Add all positionsSubtot of this phrase to the list*)&#xD;
        allPositionsSubtot = Join[allPositionsSubtot, positionsSubtot]&#xD;
        ],&#xD;
       {phrase, Keys[trainingDataSubtot]}&#xD;
       ];&#xD;
      &#xD;
      Do[&#xD;
       (*Find positionsSubtot of the current phrase in the file content*)&#xD;
    &#xD;
       &#xD;
       positionsShip = StringPosition[invoiceText, phrase];&#xD;
       &#xD;
       (*Classify the phrase if it&amp;#039;s found in the text*)&#xD;
       If[Length[positionsShip] &amp;gt; 0 &amp;amp;&amp;amp; &#xD;
         modelShip[phrase] === &amp;#034;SimilarString&amp;#034;,&#xD;
        (*Add all positionsSubtot of this phrase to the list*)&#xD;
        allPositionsShip = Join[allPositionsShip, positionsShip]&#xD;
        ],&#xD;
       {phrase, Keys[trainingDataShip]}&#xD;
       ];&#xD;
      &#xD;
      Do[&#xD;
       (*Find positionsVAT of the current phrase in the file content*)&#xD;
       positionsVAT = StringPosition[invoiceText, phrase];&#xD;
       &#xD;
       (*Classify the phrase if it&amp;#039;s found in the text*)&#xD;
       If[Length[positionsVAT] &amp;gt; 0 &amp;amp;&amp;amp; modelVAT[phrase] === &amp;#034;SimilarString&amp;#034;,&#xD;
        (*Add all positionsVAT of this phrase to the list*)&#xD;
        allPositionsVAT = Join[allPositionsVAT, positionsVAT]&#xD;
        ],&#xD;
       {phrase, Keys[trainingDataVAT]}&#xD;
       ];&#xD;
      &#xD;
      Do[&#xD;
       (*Find positionsSubtot of the current phrase in the file content*)&#xD;
    &#xD;
       &#xD;
       positionsTotal = StringPosition[invoiceText, phrase];&#xD;
       &#xD;
       (*Classify the phrase if it&amp;#039;s found in the text*)&#xD;
       If[Length[positionsTotal] &amp;gt; 0 &amp;amp;&amp;amp; &#xD;
         modelTotal[phrase] === &amp;#034;SimilarString&amp;#034;,&#xD;
        (*Add all positionsSubtot of this phrase to the list*)&#xD;
        allPositionsTotal = Join[allPositionsTotal, positionsTotal]&#xD;
        ],&#xD;
       {phrase, Keys[trainingDataTotal]}&#xD;
       ];&#xD;
      &#xD;
      (*Step 4:Extract Numbers Next to Similar Strings*)&#xD;
      allItemDescriptions = {};&#xD;
      itemDescriptions = {};&#xD;
      extractedNumbersSubtot = {};&#xD;
      extractedNumbersShip = {};&#xD;
      extractedNumbersVAT = {};&#xD;
      extractedNumbersTotal = {};&#xD;
      numberPattern = RegularExpression[&amp;#034;\\d{1,3}(,\\d{3})*(\\.\\d+)?&amp;#034;];&#xD;
      &#xD;
      Do[&#xD;
       (*Print[&amp;#034;positionsItemDesc dims = &amp;#034;,Dimensions[&#xD;
       positionsItemDesc]];*)&#xD;
       &#xD;
       If[&#xD;
        Dimensions[positionsItemDesc] =!= {0},&#xD;
        pos = &#xD;
         Flatten[positionsItemDesc][[2]];(*Get the end positionsItemDesc \&#xD;
    of the match*)&#xD;
        &#xD;
        (*Extract lines of text directly below the item description \&#xD;
    header*)&#xD;
        itemLines = StringSplit[StringDrop[invoiceText, pos], &amp;#034;\n&amp;#034;];&#xD;
        Print[&amp;#034;itemLines Dims = &amp;#034;, Dimensions[itemLines]];&#xD;
        Print[&amp;#034;Length[itemLines] = &amp;#034;, Length[itemLines]];&#xD;
        Print[&amp;#034;Min[Length[itemLines]] = &amp;#034;, Min[Length[itemLines]]];&#xD;
        (*Ensure we handle empty lines*)&#xD;
        itemIndex = 1;&#xD;
        qtyIndex = 1;&#xD;
        &#xD;
        (*Match the lines that are under the headers and collect them*)&#xD;
        Do[&#xD;
         If[StringLength[itemLines[[i]]] &amp;gt; 0,&#xD;
          Print[&amp;#034;i = &amp;#034;, i];&#xD;
          itemLine = StringTrim[itemLines[[i]]];&#xD;
          Print[&amp;#034;itemLine = &amp;#034;, itemLine];&#xD;
          AppendTo[itemDescriptions, itemLine];&#xD;
          ],&#xD;
         {i, 1, Min[Length[itemLines]]}]&#xD;
        ],&#xD;
       {positionsItemDesc, allPositionsItemDesc}&#xD;
       ];&#xD;
      &#xD;
      Do[&#xD;
       (*Print[&amp;#034;positionSubtot dims = &amp;#034;,Dimensions[positionSubtot]];*)&#xD;
       &#xD;
       If[&#xD;
        Dimensions[positionSubtot] =!= {0},&#xD;
        pos = &#xD;
         Flatten[positionSubtot][[2]];(*Get the end positionSubtot of the \&#xD;
    match*)&#xD;
        &#xD;
        (*Extract the text after the similar string&amp;#039;s positionSubtot*)&#xD;
        afterText = StringDrop[invoiceText, pos];&#xD;
        &#xD;
        (*Find the first number following the similar string*)&#xD;
        number = StringCases[afterText, numberPattern, 1];&#xD;
        &#xD;
        (*If a number is found,add it to the list of extracted numbers*)&#xD;
        If[number =!= {},&#xD;
         AppendTo[extractedNumbersSubtot, number[[1]]]&#xD;
         (*Print[&amp;#034;No number found after positionSubtot: &amp;#034;,pos]*)&#xD;
         ];&#xD;
        ],&#xD;
       {positionSubtot, allPositionsSubtot}&#xD;
       ];&#xD;
      &#xD;
      Do[&#xD;
       &#xD;
       If[&#xD;
        Dimensions[positionShip] =!= {0},&#xD;
        pos = &#xD;
         Flatten[positionShip][[2]];(*Get the end positionShip of the \&#xD;
    match*)&#xD;
        &#xD;
        (*Extract the text after the similar string&amp;#039;s positionShip*)&#xD;
        afterText = StringDrop[invoiceText, pos];&#xD;
        &#xD;
        (*Find the first number following the similar string*)&#xD;
        number = StringCases[afterText, numberPattern, 1];&#xD;
        &#xD;
        (*If a number is found,add it to the list of extracted numbers*)&#xD;
        If[number =!= {},&#xD;
         AppendTo[extractedNumbersShip, number[[1]]]&#xD;
         (*Print[&amp;#034;No number found after positionShip: &amp;#034;,pos]*)&#xD;
         ];&#xD;
        ],&#xD;
       {positionShip, allPositionsShip}&#xD;
       ];&#xD;
      &#xD;
      Do[&#xD;
       &#xD;
       If[&#xD;
        Dimensions[positionVAT] =!= {0},&#xD;
        pos = &#xD;
         Flatten[positionVAT][[2]];(*Get the end positionVAT of the match*)&#xD;
    \&#xD;
    &#xD;
        &#xD;
        (*Extract the text after the similar string&amp;#039;s positionVAT*)&#xD;
        afterText = StringDrop[invoiceText, pos];&#xD;
        &#xD;
        (*Find the first number following the similar string*)&#xD;
        number = StringCases[afterText, numberPattern, 1];&#xD;
        &#xD;
        (*If a number is found,add it to the list of extracted numbers*)&#xD;
        If[number =!= {},&#xD;
         AppendTo[extractedNumbersVAT, number[[1]]]&#xD;
         (*Print[&amp;#034;No number found after positionVAT: &amp;#034;,pos]*)&#xD;
         ];&#xD;
        ],&#xD;
       {positionVAT, allPositionsVAT}&#xD;
       ];&#xD;
      &#xD;
      Do[&#xD;
       &#xD;
       If[&#xD;
        Dimensions[positionTotal] =!= {0},&#xD;
        pos = &#xD;
         Flatten[positionTotal][[2]];(*Get the end positionTotal of the \&#xD;
    match*)&#xD;
        &#xD;
        (*Extract the text after the similar string&amp;#039;s positionTotal*)&#xD;
        afterText = StringDrop[invoiceText, pos];&#xD;
        &#xD;
        (*Find the first number following the similar string*)&#xD;
        number = StringCases[afterText, numberPattern, 1];&#xD;
        &#xD;
        (*If a number is found,add it to the list of extracted numbers*)&#xD;
        If[number =!= {},&#xD;
         AppendTo[extractedNumbersTotal, number[[1]]]&#xD;
         (*Print[&amp;#034;No number found after positionSubtot: &amp;#034;,pos]*)&#xD;
         ];&#xD;
        ],&#xD;
       {positionTotal, allPositionsTotal}&#xD;
       ];&#xD;
      &#xD;
      (*Step 6:&#xD;
      Flatten the list to handle any nested structure and get the first \&#xD;
    number*)&#xD;
      &#xD;
      firstExtractedNumberSubtot = &#xD;
       If[Length[extractedNumbersSubtot] &amp;gt; 0, &#xD;
        Flatten[extractedNumbersSubtot][[1]], &amp;#034;No numbers found&amp;#034;];&#xD;
      firstExtractedNumberShip = &#xD;
       If[Length[extractedNumbersShip] &amp;gt; 0, &#xD;
        Flatten[extractedNumbersShip][[1]], &amp;#034;No numbers found&amp;#034;];&#xD;
      firstExtractedNumberVAT = &#xD;
       If[Length[extractedNumbersVAT] &amp;gt; 0, &#xD;
        Flatten[extractedNumbersVAT][[1]], &amp;#034;No numbers found&amp;#034;];&#xD;
      firstExtractedNumberTotal = &#xD;
       If[Length[extractedNumbersTotal] &amp;gt; 0, &#xD;
        Flatten[extractedNumbersTotal][[1]], &amp;#034;No numbers found&amp;#034;];&#xD;
      &#xD;
      (*Step 10:Add the result to the firstEntriesSubtot list*)&#xD;
      AppendTo[allItemDescriptions, Flatten[itemDescriptions]];&#xD;
      AppendTo[firstEntriesSubtot, firstExtractedNumberSubtot];&#xD;
      AppendTo[firstEntriesShip, firstExtractedNumberShip];&#xD;
      AppendTo[firstEntriesVAT, firstExtractedNumberVAT];&#xD;
      AppendTo[firstEntriesTotal, firstExtractedNumberTotal],&#xD;
      {i, Length[pdfFiles]}&#xD;
      ];&#xD;
    &#xD;
    (*Final output:List of first extracted numbers for each file*)&#xD;
    Print[&amp;#034;All item descriptions for each file: &amp;#034;, allItemDescriptions];&#xD;
    Print[&amp;#034;First entries in extractedNumbersSubtot for each file: &amp;#034;, &#xD;
      firstEntriesSubtot];&#xD;
    Print[&amp;#034;First entries in extractedNumbersShip for each file: &amp;#034;, &#xD;
      firstEntriesShip];&#xD;
    Print[&amp;#034;First entries in extractedNumbersShip for each file: &amp;#034;, &#xD;
      firstEntriesVAT];&#xD;
    Print[&amp;#034;First entries in extractedNumbersTotal for each file: &amp;#034;, &#xD;
      firstEntriesTotal];&#xD;
&#xD;
The code is working well for the search strings which have the desired corresponding data to their right (trainingDataShip, trainingDataVAT, trainingDataTotal). The problems arise for the tabulated items where the desired data are below the search string headers (trainingDataItemDesc). After the invoices are converted to text format, the tables are lost so it is then not possible to extract all the data in the table cells below each header.&#xD;
&#xD;
How to go about this?</description>
    <dc:creator>Archie Watts-Farmer</dc:creator>
    <dc:date>2024-09-17T05:43:06Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3256765">
    <title>Modeling distriburted computation. How to set priority for certain rules?</title>
    <link>https://community.wolfram.com/groups/-/m/t/3256765</link>
    <description>I am modeling distributed computation using Wolfram Physics project.&#xD;
&#xD;
I have actors with memory, which compute their state and send messages to each other. All of this represented by a directed graph.&#xD;
&#xD;
We can&amp;#039;t know for sure in which order events gonna happen, and Wolfram Multiway System does perfect job simulating all possibilities, and providing states graph.&#xD;
&#xD;
However, my distributed system uses timers. Even though messages can be lost and reordered, I assume that timers **always** work for each actor.&#xD;
&#xD;
However, `MultiwaySystem` tries to apply all rules, and produce all kinds of possible states, even scenarios when timer event didn&amp;#039;t happen.&#xD;
&#xD;
I would like to filter out such branches of state evolution, otherwise state graph gonna be too cluttered.&#xD;
&#xD;
How do I do that?&#xD;
&#xD;
I came to conclusion that there are two options:&#xD;
&#xD;
 1. Filter out resulting graph. Look at each state. If at least one of the possible applied rules is a timer rule, then disregard all others. That would require some additional filtering of the resulting graph.&#xD;
 2. Find a way to set priority for rules. If there is at least one priority rule that can be applied, apply only it (timer rule). Disregard others.&#xD;
&#xD;
Second options looks cleaner. I found that there is some kind of **selection function** that is used in Wolfram MultiwaySystem: https://resources.wolframcloud.com/FunctionRepository/resources/MultiwayFunctionSystem/. However, it doesn&amp;#039;t seems like available options would suit me.&#xD;
&#xD;
Do you have any ideas how I could approach this problem?</description>
    <dc:creator>Vladimir Gordeev</dc:creator>
    <dc:date>2024-08-26T15:03:47Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3248209">
    <title>Help needed with 2D Schrödinger equation using discrete Fourier transform and Split-Operator method</title>
    <link>https://community.wolfram.com/groups/-/m/t/3248209</link>
    <description>Hello, dear forum members,  &#xD;
I have a question that I&amp;#039;ve been struggling with for some time, and despite extensive searching, I haven&amp;#039;t been able to find an answer or identify the error.  &#xD;
I’m working with the discrete Fourier transform to solve the one- and two-dimensional Schrödinger equation using the split-operator method. This involves splitting the Hamiltonian into kinetic and potential parts. As long as the time steps are sufficiently small, the split-operator method is generally a suitable approach for determining the discrete wave function. In the one-dimensional case, this method works very well compared to others (e.g., Crank-Nicolson, see attached file). However, I’m encountering issues in the two-dimensional case, where I&amp;#039;m not obtaining the expected approximate wave function. I believe the error lies in the transformation to momentum space or I may have overlooked something basic.  &#xD;
In my example, a free wave packet with momentum k in the y-direction splits into two parts after a few time steps, which doesn&amp;#039;t seem correct.  &#xD;
Could someone please help me with this issue?&#xD;
The example is taken from: J. M. Feagin, Quantum Methods with Mathematica, New York,  TELOS/Springer-Verlag, 1994.  &#xD;
Thank you in advance!&#xD;
&#xD;
    TDFourier2D[timesteps_, potheight_, ellip_] := &#xD;
     Module[{NP, L, dx, dt, kx, ky, x0, y0, xmax, xmin, ymax, ymin, kxmax,&#xD;
        kymax, \[Rho], TimeEnd, psi, K3, nt},&#xD;
      NP = 100; (* netpoints *);&#xD;
      L = 1;&#xD;
      dx = L/(NP - 1); dt = 1/20 dx^2;&#xD;
       TimeEnd = timesteps;&#xD;
       \[Rho] = 0.16;  (* initial width *)&#xD;
      x0 = 0.0 ; (* initial position *)&#xD;
      y0 = 0.0;  (* initial position *)&#xD;
      kx = 0 ;(* wave number x *)&#xD;
      ky = 50; (* wave number y *)&#xD;
      xmax = 1; (* dimension of the box *)&#xD;
      xmin = -1; (* dimension of the box *)&#xD;
      ymax = 1; (* dimension of the box *)&#xD;
      ymin = -1; (* dimension of the box *)&#xD;
      kxmax = N[Pi/dx]; (* momentum lattice x-direction*);&#xD;
      kymax = N[Pi/dx];&#xD;
      psi3[0] = &#xD;
       Array[1/(\[Rho] Sqrt[Pi]) Exp[-I kx #1 - (#1 - x0)^2/(2 \[Rho]^2)]*&#xD;
           Exp[-I ky #2 - (#2 - y0)^2/(2 \[Rho]^2)] &amp;amp;, {NP, &#xD;
          NP}, {{xmin, xmax}, {ymin, ymax}}] // Quiet;&#xD;
      K3 = Array[&#xD;
        1/2 #1^2 + 1/2 #2^2 &amp;amp;, {NP, &#xD;
         NP}, {{-kxmax, kxmax}, {-kymax, kymax}}]; &#xD;
      V3 = Array[&#xD;
        potheight/2 #1^2 + ellip*potheight/2 #2^2 &amp;amp;, {NP, &#xD;
         NP}, {{xmin, xmax}, {ymin, ymax}}]; &#xD;
      UV[dt] = Exp[-I V3 dt];&#xD;
      UK[dt] = Exp[-I K3 dt];&#xD;
      U[dt_]@psi_ := UV[dt]*InverseFourier[UK[dt]*Fourier[psi]];&#xD;
      psi3[nt_, psi0_] := Nest[U[dt][#] &amp;amp;, psi0, nt];&#xD;
      Do[psi3[nt] = psi3[1, psi3[nt - 1]], {nt, 1, TimeEnd, 1}];&#xD;
      ]&#xD;
    ellipticalform = &#xD;
      0.2; (*elliptical form from from &amp;gt; 0 and &amp;lt;= 1; 1=cylindrical*)&#xD;
    TimeEnd = 160; (* timesteps 10 to 150 *)&#xD;
    potheight = 0; (*potential height, free particle *)&#xD;
    (TDFourier2D[TimeEnd, potheight, ellipticalform]) // AbsoluteTiming&#xD;
    graphTable1 = &#xD;
     GraphicsGrid[&#xD;
      Partition[&#xD;
       Table[Labeled[&#xD;
         ListDensityPlot[Abs[psi3[i]], Axes -&amp;gt; True, PlotRange -&amp;gt; All, &#xD;
          ColorFunction -&amp;gt; &amp;#034;SunsetColors&amp;#034;, &#xD;
          PerformanceGoal -&amp;gt; &amp;#034;Quality&amp;#034;], {&amp;#034;x&amp;#034;, &amp;#034;y&amp;#034;}, {Left, Top}, &#xD;
         RotateLabel -&amp;gt; True], {i, 1, TimeEnd, TimeEnd/4}], 2], &#xD;
      Frame -&amp;gt; All, ImageSize -&amp;gt; 400]&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=DiscreteFourier2DAug14.gif&amp;amp;userId=73791</description>
    <dc:creator>Klaus von Bloh</dc:creator>
    <dc:date>2024-08-14T07:32:55Z</dc:date>
  </item>
</rdf:RDF>

